Skip to content

defineVaporComponent types #45

Description

@TiBianMod

I thought the types are fixed on this PR vuejs/core#13831

previous issue: #17

component

import { defineVaporComponent, ref } from "vue";
import type { ButtonHTMLAttributes } from "vue-jsx-vapor";

interface ButtonProps extends ButtonHTMLAttributes<{}> {
    variant?: "default" | "danger" | "light";
}

export const Button = defineVaporComponent<ButtonProps>({
    name: "Button",
    setup() {
        const foo = ref("4453");

        return { foo };
    },
    render(data, props) {
        return <button>Value: {data.foo}</button>;
    },
});

NO AUTOCOMPLETE !!!

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions