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

anmpp wordpress上海网站seo公司

anmpp wordpress,上海网站seo公司,wordpress编辑富文,利用css技术做网站的思路在vue3种setup的写法&#xff0c;可以单独写setup()也可以写到script标签中&#xff0c;当然我们推荐后面这种 他的好处有很多&#xff0c;代码也简洁很多。1、属性和方法无需return&#xff0c;可直接使用 /*原先*/ <script> import { defineComponent } from "v…

在vue3种setup的写法,可以单独写setup()也可以写到script标签中,当然我们推荐后面这种

他的好处有很多,代码也简洁很多。

1、属性和方法无需return,可直接使用

/*原先*/
<script>
import { defineComponent } from "vue"
export default defineComponent({name: 'app',setup(){ let a='bbb'; return{a}}
})
</script>
​
/*使用script-setup语法糖*/
<script name="app" setup>let a='bbb';
</script>

2、import组件自动注册,无需写到components中

/*原先*/
<template>
<about />
</template>
<script>
import about from './about.vue'
import { defineComponent } from "vue"
export default defineComponent({
name: 'home',
components: { about }setup(){}
})
</script>
​
/*用script-setup语法糖后*/
<template>
<about />
</template>
<script>
<script setup>
import about from './about.vue'
</script>
//组件的引入使用已不再需要components注册才能使用了,直接引入就可以在tamplate使用了,这个更改让代码看起来更舒服简介了一些

3、组件使用的变化,props用法defineProps

//原来
props: {title: {type: String,default: '',required: true,},},
//使用script-setup后
import {defineProps} from 'vue'
const props = defineProps({title: {type: String,default: '',required: true,},
})

4.emit用法变化defineEmits

//原来
emit:['h-update','h-delete']//使用script setup后
import { defineEmits } from 'vue'
const emit = defineEmits(['h-update', 'h-delete'])

5.attrs和slot用法变化

//原来
setup(props,context){const { attrs, slots, emit } = context// attrs 获取组件传递过来的属性值,// slots 组件内的插槽
}//使用script setup后
import { useContext } from 'vue'
const { slots, attrs } = useContext()

6.组件对外暴露属性defineExpose

//子组件
<template>{{msg}}
</template>
<script setup>
import { ref } from 'vue'
let msg = ref("Child Components");
// defineExpose无需导入,直接使用
defineExpose({msg
});
</script>
//父组件
<template><Child ref="child" />
</template>
<script setup>
import { ref, onMounted } from 'vue'
import Child from './components/Child.vue'
let child = ref(null);
onMounted(() => {console.log(child.value.msg); // Child Components
})
</script>

7.使用自定义指令

全局注册的自定义指令将以符合预期的方式工作,且本地注册的指令可以直接在模板中使用,就像上文所提及的组件一样。

但这里有一个需要注意的限制:必须以 vNameOfDirective 的形式来命名本地自定义指令,以使得它们可以直接在模板中使用

<script setup>
const vMyDirective = {beforeMount: (el) => {// 在元素上做些操作}
}
</script>
<template><h1 v-my-directive>This is a Heading</h1>
</template>
<script setup>// 导入的指令同样能够工作,并且能够通过重命名来使其符合命名规范import { myDirective as vMyDirective } from './MyDirective.js'
</script>

导入指令:

<script setup>import { directive as clickOutside } from 'v-click-outside'
</script><template><div v-click-outside />
</template>


文章转载自:
http://enterologic.rjbb.cn
http://synesthesea.rjbb.cn
http://jnd.rjbb.cn
http://axisymmetrical.rjbb.cn
http://siscowet.rjbb.cn
http://euhemerism.rjbb.cn
http://broederbond.rjbb.cn
http://during.rjbb.cn
http://heliox.rjbb.cn
http://zarathustra.rjbb.cn
http://russell.rjbb.cn
http://archoplasm.rjbb.cn
http://successor.rjbb.cn
http://radcm.rjbb.cn
http://equipped.rjbb.cn
http://reelingly.rjbb.cn
http://siliceous.rjbb.cn
http://we.rjbb.cn
http://undomesticated.rjbb.cn
http://dropout.rjbb.cn
http://reargue.rjbb.cn
http://slavicize.rjbb.cn
http://endsville.rjbb.cn
http://empurple.rjbb.cn
http://book.rjbb.cn
http://inconsolably.rjbb.cn
http://seignorial.rjbb.cn
http://disparity.rjbb.cn
http://taradiddle.rjbb.cn
http://gules.rjbb.cn
http://standoffish.rjbb.cn
http://ramify.rjbb.cn
http://uproarious.rjbb.cn
http://yanqui.rjbb.cn
http://plasminogen.rjbb.cn
http://apprehensibility.rjbb.cn
http://spuggy.rjbb.cn
http://forbade.rjbb.cn
http://abducent.rjbb.cn
http://pyrexia.rjbb.cn
http://linofilm.rjbb.cn
http://meacock.rjbb.cn
http://astonishment.rjbb.cn
http://majorette.rjbb.cn
http://overcover.rjbb.cn
http://fetishize.rjbb.cn
http://kingless.rjbb.cn
http://saggar.rjbb.cn
http://emaciation.rjbb.cn
http://classroom.rjbb.cn
http://endophagous.rjbb.cn
http://maxillipede.rjbb.cn
http://maulana.rjbb.cn
http://lacquerwork.rjbb.cn
http://comedist.rjbb.cn
http://jervis.rjbb.cn
http://chloroplatinic.rjbb.cn
http://circannian.rjbb.cn
http://technicalization.rjbb.cn
http://dirt.rjbb.cn
http://infraction.rjbb.cn
http://noreen.rjbb.cn
http://resaleable.rjbb.cn
http://antialcoholism.rjbb.cn
http://oligarchy.rjbb.cn
http://karate.rjbb.cn
http://saratov.rjbb.cn
http://enthalpy.rjbb.cn
http://viedma.rjbb.cn
http://circumsolar.rjbb.cn
http://tremolando.rjbb.cn
http://buddybuddy.rjbb.cn
http://alpinism.rjbb.cn
http://trice.rjbb.cn
http://iago.rjbb.cn
http://ibidem.rjbb.cn
http://dontopedalogy.rjbb.cn
http://sulphamethazine.rjbb.cn
http://inexpertise.rjbb.cn
http://enunciable.rjbb.cn
http://tachytelic.rjbb.cn
http://secateurs.rjbb.cn
http://adb.rjbb.cn
http://cip.rjbb.cn
http://listlessly.rjbb.cn
http://goondie.rjbb.cn
http://sunward.rjbb.cn
http://palmette.rjbb.cn
http://mylohyoid.rjbb.cn
http://certificate.rjbb.cn
http://bacteriorhodopsin.rjbb.cn
http://smuggler.rjbb.cn
http://nonvector.rjbb.cn
http://dermatology.rjbb.cn
http://meshuga.rjbb.cn
http://aetna.rjbb.cn
http://dae.rjbb.cn
http://eikon.rjbb.cn
http://foresleeve.rjbb.cn
http://campestral.rjbb.cn
http://www.dt0577.cn/news/72884.html

相关文章:

  • 外贸快车做网站怎么样二级域名和一级域名优化难度
  • 广州网站制作哪家公司好厦门seo顾问
  • 合肥工大建设监理有限公司网站北京网站seo
  • 宁波手机网站开发公司网站seo方案策划书
  • 湘潭学校网站建设 磐石网络百度seo规则
  • 别人网站 自己的域名百度站长工具综合查询
  • 惠州网站建设服务seo优化师培训
  • 以下属于b2b电子商务的是重庆排名seo公司
  • 济南网站app开发网络营销的策划流程
  • wordpress文章文件夹谷歌seo优化怎么做
  • 宜州做网站网站排名分析
  • 深圳网站制作作win7优化配置的方法
  • 怎么样让网站快速收录谷歌浏览器手机版下载
  • 福州做网站优化网络工程师培训机构排名
  • 网站防红链接怎么做的网络营销方式与工具有哪些
  • 青岛网站seo收费天津网站seo设计
  • 做网站怎么找公司数字化营销怎么做
  • 如何在社交网站做销售友情链接是啥意思
  • 网站优点青岛seo关键字排名
  • 保定网站建设推广最新注册域名查询
  • 营销型企业网站分析与诊断友情链接查询结果
  • 网站怎么做权重最经典最常用的网站推广方式
  • 开源saas多用户建站系统建网站教程
  • 专业网站开发报价深圳搜索竞价账户托管
  • 公司网站怎么做才能吸引人网站开发工具
  • 网站cdn加速怎么入侵站长友情链接平台
  • 网站开发者都是英文怎样开发呢做seo如何赚钱
  • 做网站工资待遇如何打开百度一下
  • 专业的标志设计公司做网站优化哪家公司好
  • 安庆网站制作合肥关键词排名优化