Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
339 views
in Technique[技术] by (71.8m points)

javascript - 在Nuxt的模板中使用Mixin(Use Mixin in template with Nuxt)

I am trying to call the mixin function within the template.(我正在尝试在模板中调用mixin函数。)

Vue documentation says mixin and the component are merged but i can't call the function.(Vue文档说mixin和组件已合并,但我不能调用该函数。) getImage is not a function(getImage不是一个函数) Mixin(混合蛋白) export default { data() { return { l: 2, output: 'webp' } }, methods: { getImage() { return 'www.example.url' } } } Component(零件) <template> <v-img :src="getImage()" /> </template> <script> import imageMixin from '~/mixins/image' export default { name: 'New', mixin: { imageMixin } } </script> <style scoped></style>   ask by F4ll0ut translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...