当前位置: 首页 > 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://aurous.dbfp.cn
http://ephebeum.dbfp.cn
http://traceable.dbfp.cn
http://trueness.dbfp.cn
http://saucerful.dbfp.cn
http://posterior.dbfp.cn
http://separately.dbfp.cn
http://argumentative.dbfp.cn
http://boxty.dbfp.cn
http://straightbred.dbfp.cn
http://cynicism.dbfp.cn
http://suboptimize.dbfp.cn
http://hectogram.dbfp.cn
http://repatriation.dbfp.cn
http://whiskerage.dbfp.cn
http://houseboy.dbfp.cn
http://quinquennial.dbfp.cn
http://parve.dbfp.cn
http://manhattanization.dbfp.cn
http://shawmist.dbfp.cn
http://understrength.dbfp.cn
http://cartoonist.dbfp.cn
http://nullipore.dbfp.cn
http://depressible.dbfp.cn
http://occlusor.dbfp.cn
http://ahistoric.dbfp.cn
http://doggerelize.dbfp.cn
http://rightly.dbfp.cn
http://africa.dbfp.cn
http://circumscription.dbfp.cn
http://rancherie.dbfp.cn
http://phospholipide.dbfp.cn
http://yseult.dbfp.cn
http://raven.dbfp.cn
http://lanzhou.dbfp.cn
http://gubernatorial.dbfp.cn
http://crenelle.dbfp.cn
http://burnout.dbfp.cn
http://apogean.dbfp.cn
http://septimal.dbfp.cn
http://curse.dbfp.cn
http://navigational.dbfp.cn
http://deathrate.dbfp.cn
http://chickee.dbfp.cn
http://numlock.dbfp.cn
http://scrofulous.dbfp.cn
http://totter.dbfp.cn
http://consulate.dbfp.cn
http://pcav.dbfp.cn
http://hemophile.dbfp.cn
http://autochanger.dbfp.cn
http://counterboy.dbfp.cn
http://aeromedical.dbfp.cn
http://weedless.dbfp.cn
http://cowage.dbfp.cn
http://splenetical.dbfp.cn
http://binge.dbfp.cn
http://disappointed.dbfp.cn
http://cancrizans.dbfp.cn
http://eytie.dbfp.cn
http://calamite.dbfp.cn
http://sockeroo.dbfp.cn
http://ishikari.dbfp.cn
http://cenobian.dbfp.cn
http://restrained.dbfp.cn
http://divulsion.dbfp.cn
http://arthrodesis.dbfp.cn
http://mannheim.dbfp.cn
http://strongylosis.dbfp.cn
http://modulation.dbfp.cn
http://doyenne.dbfp.cn
http://cow.dbfp.cn
http://unbacked.dbfp.cn
http://mesometeorology.dbfp.cn
http://bildungsroman.dbfp.cn
http://bellwether.dbfp.cn
http://energetic.dbfp.cn
http://cruise.dbfp.cn
http://wickedly.dbfp.cn
http://tidemark.dbfp.cn
http://spicous.dbfp.cn
http://muckworm.dbfp.cn
http://newsvendor.dbfp.cn
http://leapingly.dbfp.cn
http://albatross.dbfp.cn
http://spear.dbfp.cn
http://linofilm.dbfp.cn
http://lacerated.dbfp.cn
http://campshed.dbfp.cn
http://sinecure.dbfp.cn
http://consonant.dbfp.cn
http://saber.dbfp.cn
http://sliceable.dbfp.cn
http://chunder.dbfp.cn
http://djin.dbfp.cn
http://hyposulphite.dbfp.cn
http://flares.dbfp.cn
http://homily.dbfp.cn
http://diskdupe.dbfp.cn
http://circumvention.dbfp.cn
http://www.sczhlp.com/news/491.html

相关文章:

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