摘要: 1 import md5 from 'md5' 2 3 // 创建 Vue 实例 4 const app = createApp(App) 5 6 // 把插件的 API 挂载全局变量到实例上 7 app.config.globalProperties.$md5 = md5; 8 9 // 你也可以 阅读全文
posted @ 2022-07-09 15:34 googlegis 阅读(550) 评论(0) 推荐(0) 编辑
摘要: 编写自定义插件 1 // src/plugins/directive.ts 2 import type { App } from 'vue' 3 4 // 插件选项的类型 5 interface Options { 6 // 文本高亮选项 7 highlight?: { 8 // 默认背景色 9 b 阅读全文
posted @ 2022-07-09 15:26 googlegis 阅读(504) 评论(0) 推荐(0) 编辑
摘要: 1. style 中使用v-bind 不支持响应式渲染 1 <template> 2 <p class="msg">Hello World!</p> 3 </template> 4 5 <script lang="ts"> 6 import { defineComponent, ref } from 阅读全文
posted @ 2022-07-09 11:25 googlegis 阅读(270) 评论(0) 推荐(0) 编辑
摘要: 1 <template> 2 <input 3 type="text" 4 v-model="tagsStr" 5 placeholder="请输入标签,多个标签用英文逗号隔开" 6 /> 7 </template> 8 9 <script lang="ts"> 10 import { define 阅读全文
posted @ 2022-07-09 10:44 googlegis 阅读(655) 评论(0) 推荐(0) 编辑
摘要: 1 // 请求列表 2 const getArticleList = async (): Promise<void> => { 3 // ... 4 articleList.value = await axios({ 5 method: 'get', 6 url: apiUrl.value, 7 / 阅读全文
posted @ 2022-07-09 10:35 googlegis 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 1 // 还是这2个数据源 2 const firstName = ref<string>('Bill') 3 const lastName = ref<string>('Gates') 4 5 // 这里我们配合setter的需要,改成了另外一种写法 6 const fullName = comp 阅读全文
posted @ 2022-07-09 10:10 googlegis 阅读(1248) 评论(0) 推荐(0) 编辑
摘要: 1 // 不要忘了导入要用的 API 2 import { defineComponent, reactive, watch } from 'vue' 3 4 export default defineComponent({ 5 setup() { 6 // 定义一个响应式数据 7 const us 阅读全文
posted @ 2022-07-09 09:28 googlegis 阅读(3229) 评论(0) 推荐(1) 编辑
摘要: 内容来自于: https://vue3.chengpeiquan.com/component.html#变量的读取与赋值-1 如果你使用常规的重置,会导致这个变量失去响应性: 1 /** 2 * 不推荐使用这种方式 3 * 异步添加数据后,模板不会响应更新 4 */ 5 let uids: numb 阅读全文
posted @ 2022-07-09 09:05 googlegis 阅读(2053) 评论(0) 推荐(0) 编辑

坐标合肥,非典型GIS开发人员 GitHub