随笔分类 -  Vue

摘要:toRefs是Vue.js 3中的一个实用函数,用于将响应式对象转换为普通对象,其中每个属性都是一个ref对象。这在某些情况下很有用,特别是想要将一个包含多个响应式属性的对象传递给子组件时。 以下是toRefs的基本用法: import { reactive, toRefs } from 'vue' 阅读全文
posted @ 2023-12-25 20:46 __username 阅读(559) 评论(0) 推荐(0)
摘要:安装pnpm pnpm create vite@latest my-vue-app -- --template vue cd my-vue-app pnpm install pnpm run dev 文档 https://cn.vitejs.dev/ 阅读全文
posted @ 2023-12-25 07:38 __username 阅读(20) 评论(0) 推荐(0)
摘要:<script setup> import { computed, ref } from "vue"; // const blog = ref({ // title: "Vue3 基础教程", // content: "Vue3 在 Vue2 的基础上做了很多优化", // link: "https 阅读全文
posted @ 2023-12-05 16:00 __username 阅读(61) 评论(0) 推荐(0)
摘要:本地部署 const { defineConfig } = require('@vue/cli-service') module.exports = defineConfig({ transpileDependencies: true, // devServer: { // open: true, 阅读全文
posted @ 2023-11-09 13:54 __username 阅读(213) 评论(0) 推荐(0)