您好,登錄后才能下訂單哦!
本文小編為大家詳細(xì)介紹“Vue extends屬性怎么使用”,內(nèi)容詳細(xì),步驟清晰,細(xì)節(jié)處理妥當(dāng),希望這篇“Vue extends屬性怎么使用”文章能幫助大家解決疑惑,下面跟著小編的思路慢慢深入,一起來學(xué)習(xí)新知識(shí)吧。
<template> <div> <Son></Son> </div> </template> <script> import Son from "./components/Son"; export default { components: { Son, }, }; </script> <style scoped></style>
<template> </template> <script> import HelloWorld from "./HelloWorld.vue"; export default { extends: HelloWorld, data() { return { aa: 10, }; }, }; </script>
<template> <div> <h2>{{ aa }}</h2> <h2>{{ bb }}</h2> </div> </template> <script> export default { data() { return { aa: 0, bb: 123, }; }, mounted() { this.init(); }, methods: { init() { this.aa += 10; }, }, }; </script> <style scoped></style>
讀到這里,這篇“Vue extends屬性怎么使用”文章已經(jīng)介紹完畢,想要掌握這篇文章的知識(shí)點(diǎn)還需要大家自己動(dòng)手實(shí)踐使用過才能領(lǐng)會(huì),如果想了解更多相關(guān)內(nèi)容的文章,歡迎關(guān)注億速云行業(yè)資訊頻道。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請(qǐng)聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。