Closed waylau closed 3 years ago
My answer to my question is change AnchoredHeading.vue into pure Typescript class AnchoredHeading.ts ,and it works.
Here is my code:
import { Options, Vue } from "vue-class-component";
import { h } from "vue";
@Options({
render() {
return h(
'h' + this.level, // 标签名称
{}, // prop/attribute
this.$slots.default()
)
},
props: {
level: Number
}
})
export default class AnchoredHeading extends Vue {
level!: Number;
}
I want use render() in vue-class-component way , I follow this Render Functions guide (https://v3.vuejs.org/guide/render-function.html), but it doesn't work.
My code AnchoredHeading.vue is here:
and import AnchoredHeading in App.vue like: