joken-前端工程师

  :: 首页 :: 博问 :: 闪存 :: 新随笔 :: :: :: 管理 ::

2024年7月8日

摘要: 代码 <template> <div class="box">childB</div> </template> <script lang="ts" setup> import { reactive, watch, ref } from "vue"; const data1 = reactive({ 阅读全文
posted @ 2024-07-08 21:43 joken1310 阅读(2) 评论(0) 推荐(0) 编辑

摘要: 概论 defineEmits 用来定义子组件暴漏给父组件的自定义事件 测试代码 子组件 <template> <div class="box">child</div> </template> <script lang="ts" setup> interface Emit { (e: "emitfn1 阅读全文
posted @ 2024-07-08 21:18 joken1310 阅读(2) 评论(0) 推荐(0) 编辑

摘要: 自动导入vite配置 需要安装: npm install -D unplugin-vue-components unplugin-auto-import vite.config.ts配置 // vite.config.ts import { defineConfig } from 'vite' im 阅读全文
posted @ 2024-07-08 00:07 joken1310 阅读(2) 评论(0) 推荐(0) 编辑

摘要: 安装 # 使用 npm npm install pinia@next # 使用 yarn yarn add pinia@next 代码使用 store代码 import { ref, computed } from 'vue' import { defineStore } from 'pinia' 阅读全文
posted @ 2024-07-08 00:03 joken1310 阅读(1) 评论(0) 推荐(0) 编辑