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

烟台 做网站的公司seo系统优化

烟台 做网站的公司,seo系统优化,wordpress文章无法显示,磁力蜘蛛种子搜索在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://www.ritt.cn/news/2068.html

相关文章:

  • 网站建设安全与威胁国内免费推广产品的网站
  • wordpress微信商户支付百度优化公司
  • 网站源码还可以做授权么著名的个人网站
  • 茂名网站制作价格网站一键生成
  • 新网站提交百度收录seo刷关键词排名工具
  • wordpress分类添加htmlseo博客推广
  • 深圳市企业网站seo营销工具重庆seo技术博客
  • 网站服务器租用还是托管呢武汉全网营销推广公司
  • 网页兼容性站点seo产品是什么意思
  • 玉溪网站建设制作美国今天刚刚发生的新闻
  • 做一网站要什么个人怎么做网站
  • 网站建设公司考察域名备案查询
  • 青岛微网站开发百度云搜索引擎入口
  • wordpress建设购物网站百度官方优化软件
  • 影响网站排名的因素 权重小程序开发哪家更靠谱
  • 拦截WordPress请求南京谷歌seo
  • 网络架构和网络拓扑的区别中山seo
  • 想自己做网站需要会什么软件推广联盟平台
  • 辽宁网站建设多少钱推广优化网站
  • 河源wordpress培训百度seo点击工具
  • 做网站app公司前景线上直播营销策划方案
  • 网站建立后被别人点击要付钱吗优化人员配置
  • 团购鲜花的网站建设找人帮忙注册app推广
  • 网站开发武汉公司成都有实力的seo团队
  • 网站建设的利益如何推广软件
  • 禹城网站设计百度识图查另一半情头
  • 汾阳做网站大数据精准营销系统
  • 东莞市网络优化推广服务机构嘉兴seo外包平台
  • 简述电子商务网站的建站流程百度极速版推广员怎么申请
  • 写作网站新手百度指数代表什么意思