- 博客(6)
- 收藏
- 关注
原创 vue3 setup种使用全局变量 globalProperties
getCurrentInstance 支持访问内部组件实例。 1.main.ts使用 app.config.globalProperties.$filter = { foo() { return 123 }, bar() { console.log("我是bar") return "我是bar" } } 2.在template中使用 {{ $filter.foo() }} 3.在setup中使用 const internalInstance = getCurre
2021-10-18 14:28:59
4688
1
原创 vue3中vuex的使用和封装
vue3中,setup没有this,需要引入useStore ,封装代码在下 home页 <template> <div class="home"> {{indexName}} </div> </template> <script> import { computed } from 'vue'; // @ is an alias to /src import { mapState, useStore } from 'vuex'; im
2021-08-18 16:47:22
617
原创 去除html标签
/** * @description: 去除html标签 * @param : str:传入的html文本 * @return {str} 返回去除html的文本 */ delHtmlTag (str) { return str.replace(/<[^>]+>/g, "").substring(0, 52); },
2021-07-09 16:05:17
82
原创 vue上拉加载
<template> <div id="app"> <!-- <HelloWorld ref="LoadMore" @loadMore="onScrollBottom"> --> <div class="root"> <div :class="tabIndex==index?'colorSt':''" @click="tabClick(index)"
2021-07-06 15:09:47
180
原创 vite和vite脚手架的安装
vite npm install vite -g, vite脚手架 npm install @vitejs/create-app -g
2021-07-05 11:10:10
911
原创 vue2和vue3过渡class变化
vue2过渡class .fade-enter, .fade-enter-active, .fade-enter-to, .fade-leave, .fade-leave-active, .fade-leave-to, vue3过渡class .fade-enter-from, .fade-enter-active, .fade-enter-to, .fade-leave-from, .fade-leave-active, .fade-leave-to,
2021-07-05 10:56:00
124
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人