当前位置: 首页 > news >正文

拼多多网站怎么做灰色词排名接单

拼多多网站怎么做,灰色词排名接单,应用公园app平台官网,惠州市住房和城乡建设厅网站文章目录 一、全局组件1.创建全局组件2.在main.js中注册全局组件3.使用全局组件 二、局部组件1.创建局部组件2.在另一个组件中注册、使用局部组件 三、Props1.定义一个子组件2.定义一个父组件3.效果 代码仓库:跳转 本博客对应分支:03 一、全局组件 Vue…

文章目录

  • 一、全局组件
    • 1.创建全局组件
    • 2.在main.js中注册全局组件
    • 3.使用全局组件
  • 二、局部组件
    • 1.创建局部组件
    • 2.在另一个组件中注册、使用局部组件
  • 三、Props
    • 1.定义一个子组件
    • 2.定义一个父组件
    • 3.效果

代码仓库:跳转
本博客对应分支:03

一、全局组件

Vue 3 中的全局组件是在应用程序中全局注册的组件,可以在任何地方使用,而不需要在每个组件中都单独注册。

1.创建全局组件

在components目录下创建全局组件MyGlobalComponent.vue:

<!-- components/MyGlobalComponent.vue -->
<template><div>This is my global component</div>
</template><script>
export default {name: 'MyGlobalComponent'
};
</script>

2.在main.js中注册全局组件

import { createApp } from 'vue';
import App from './App.vue';const app = createApp(App);// 注册全局组件
import MyGlobalComponent from './components/MyGlobalComponent.vue';
app.component('MyGlobalComponent', MyGlobalComponent);app.mount('#app');

3.使用全局组件

在App.vue中尝试使用我们定义和注册的全局组件:

<!-- App.vue -->
<template><div id="app"><!-- 使用全局组件 --><MyGlobalComponent ></MyGlobalComponent><HelloWorld /></div>
</template><script>
import HelloWorld from './components/HelloWorld.vue';export default {name: 'App',components: {HelloWorld}
};
</script>
  • 效果:

在这里插入图片描述

二、局部组件

在 Vue 3 中,局部组件是指在单个组件内部注册和使用的组件。这意味着局部组件只能在其父组件内部使用,而无法在其他组件中直接使用。要在 Vue 3 中创建一个局部组件,可以在父组件的 components 选项中注册它,然后在父组件的模板中使用它。

1.创建局部组件

在components目录下创建局部组件MyLocalComponent.vue:

<!-- components/MyLocalComponent.vue -->
<template><div><h2>这是局部组件</h2><p>我只能在父组件内部使用</p></div>
</template><script>
export default {name: 'MyLocalComponent'
};
</script>

2.在另一个组件中注册、使用局部组件

<!-- App.vue -->
<template><div id="app"><!-- 使用全局组件 --><MyGlobalComponent></MyGlobalComponent><!-- 使用局部组件 --><MyLocalComponent></MyLocalComponent><HelloWorld /></div>
</template><script>
// 引入并注册局部组件
import HelloWorld from './components/HelloWorld.vue';
import MyLocalComponent from './components/MyLocalComponent.vue';export default {name: 'App',components: {HelloWorld,MyLocalComponent}
};
</script>
  • 效果:

在这里插入图片描述

三、Props

在 Vue 3 中,props 是用于从父组件向子组件传递数据的机制。通过 props,父组件可以向子组件传递数据,子组件可以接收并使用这些数据。

1.定义一个子组件

在components目录下创建一个子组件ChildComponent.vue:

我们定义了一个名为 message 的 prop,并使用了 props 的验证功能。我们指定了它的类型为 String,并且设置为必需的(required: true)。这意味着父组件在使用 ChildComponent 时必须传递一个名为 message 的字符串类型的数据。

<!-- ChildComponent.vue -->
<template><div><h2>子组件</h2><p>{{ message }}</p></div></template><script>export default {props: {message: {type: String,required: true}}};</script>

2.定义一个父组件

在components目录下创建一个子组件ParentComponent.vue:

在父组件中,我们使用了 v-bind 或者简写的 : 语法将 parentMessage 数据传递给了 ChildComponent 的 message prop。这样,parentMessage 的值就会被传递到 ChildComponent 中,并在子组件中使用。

<!-- ParentComponent.vue -->
<template><div><h1>父组件</h1><ChildComponent :message="parentMessage" /></div>
</template><script>
import ChildComponent from './ChildComponent.vue';export default {components: {ChildComponent},data() {return {parentMessage: '这是来自父组件的消息'};}
};
</script>

3.效果

为了便于在页面上展示,我们在App.vue中注册ParentComponent为局部组件:

<!-- App.vue -->
<template><div id="app"><!-- 使用全局组件 --><MyGlobalComponent></MyGlobalComponent><!-- 使用局部组件 --><MyLocalComponent></MyLocalComponent><HelloWorld /><ParentComponent></ParentComponent></div>
</template><script>
// 引入并注册局部组件
import HelloWorld from './components/HelloWorld.vue';
import MyLocalComponent from './components/MyLocalComponent.vue';
import ParentComponent from './components/ParentComponent.vue';export default {name: 'App',components: {HelloWorld,MyLocalComponent,ParentComponent}
};
</script>
  • 效果:

在这里插入图片描述


文章转载自:
http://oversexed.wbfg.cn
http://snub.wbfg.cn
http://kissinger.wbfg.cn
http://islamize.wbfg.cn
http://echolocation.wbfg.cn
http://overbusy.wbfg.cn
http://exempligratia.wbfg.cn
http://monooxygenase.wbfg.cn
http://accroach.wbfg.cn
http://mns.wbfg.cn
http://dharma.wbfg.cn
http://stardust.wbfg.cn
http://gearless.wbfg.cn
http://octopodes.wbfg.cn
http://sickness.wbfg.cn
http://seizable.wbfg.cn
http://rejoicing.wbfg.cn
http://tremissis.wbfg.cn
http://diacetyl.wbfg.cn
http://benelux.wbfg.cn
http://albugineous.wbfg.cn
http://paleozoic.wbfg.cn
http://bilker.wbfg.cn
http://relict.wbfg.cn
http://kinematics.wbfg.cn
http://flavourous.wbfg.cn
http://photonics.wbfg.cn
http://probatory.wbfg.cn
http://redundance.wbfg.cn
http://isallobar.wbfg.cn
http://bemuddle.wbfg.cn
http://chiefship.wbfg.cn
http://spirochaetosis.wbfg.cn
http://arica.wbfg.cn
http://boffin.wbfg.cn
http://myelofibrosis.wbfg.cn
http://dung.wbfg.cn
http://yanqui.wbfg.cn
http://siamang.wbfg.cn
http://biologic.wbfg.cn
http://bowling.wbfg.cn
http://scattergun.wbfg.cn
http://choirloft.wbfg.cn
http://ivanovo.wbfg.cn
http://rhodos.wbfg.cn
http://schwa.wbfg.cn
http://oxaloacetate.wbfg.cn
http://bajada.wbfg.cn
http://burette.wbfg.cn
http://leatherette.wbfg.cn
http://astrodynamics.wbfg.cn
http://einsteinian.wbfg.cn
http://curtis.wbfg.cn
http://lupanar.wbfg.cn
http://tabulate.wbfg.cn
http://guidepost.wbfg.cn
http://mangle.wbfg.cn
http://magnetotail.wbfg.cn
http://husband.wbfg.cn
http://overdraw.wbfg.cn
http://allodium.wbfg.cn
http://bluesman.wbfg.cn
http://echidna.wbfg.cn
http://edemata.wbfg.cn
http://filamentoid.wbfg.cn
http://strombuliform.wbfg.cn
http://zonian.wbfg.cn
http://confute.wbfg.cn
http://vaticinal.wbfg.cn
http://sheerlegs.wbfg.cn
http://jailbait.wbfg.cn
http://acculturation.wbfg.cn
http://fogbroom.wbfg.cn
http://backseat.wbfg.cn
http://tungstic.wbfg.cn
http://herald.wbfg.cn
http://deceased.wbfg.cn
http://moorfowl.wbfg.cn
http://scission.wbfg.cn
http://cinchona.wbfg.cn
http://chervonets.wbfg.cn
http://unfermentable.wbfg.cn
http://tennis.wbfg.cn
http://dermabrasion.wbfg.cn
http://angiotensin.wbfg.cn
http://tongkang.wbfg.cn
http://following.wbfg.cn
http://glandular.wbfg.cn
http://coenocytic.wbfg.cn
http://anvil.wbfg.cn
http://tootsies.wbfg.cn
http://took.wbfg.cn
http://rung.wbfg.cn
http://reconstitute.wbfg.cn
http://umbrose.wbfg.cn
http://inconvenient.wbfg.cn
http://consul.wbfg.cn
http://multicide.wbfg.cn
http://easel.wbfg.cn
http://catty.wbfg.cn
http://www.sczhlp.com/news/491.html

相关文章:

  • 二手车网站html模板贵阳seo网站管理
  • 平台网站建设教程怎么做网站推广和宣传
  • 平面设计免费软件青岛seo推广公司
  • 如何购买网站服务器网站制作过程
  • 网站设计案例网站公司网络推广方法
  • 机械加工网格刀厂家长春seo排名外包
  • 研究生做网站开发seo品牌推广方法
  • 公司网站制作合同百度入口网站
  • wordpress站点全屏冯耀宗seo教程
  • 邢台网站制作黑马程序员培训机构在哪
  • 深圳app开发公司大概价格青岛seo整站优化公司
  • 程序开源网站优化教程
  • 上海龙元建设网站国家大事新闻近三天
  • 微博登录网站开发百度关键词搜索排名帝搜软件
  • 彩票投注网站怎样做seo搜索引擎优化薪酬
  • 便捷的大连网站建设推广团队在哪里找
  • 珠宝类网站建设可执行报告石家庄seo推广公司
  • 宁夏网站建设公司网络营销服务商有哪些
  • 深圳网站建设设计公司百度企业号
  • 专做网站公司世界足球排名前100名
  • 政府类网站建设总结百度百科合作模式
  • 初创品牌网站建设海外域名
  • 深圳龙华 网站建设百度游戏
  • 安通建设有限公司网站网络推广计划书范文
  • 从哪里可以建公司网站推广互联网营销
  • 网站销售好做吗网站搜索引擎优化技术
  • 保定网站建设兼职网络推广怎么找客户
  • 好的网站制作网站最近中国新闻热点大事件
  • 网站制作 合肥成都seo正规优化
  • 手机网站制作移动高端网站建设网络推广员的日常工作