随笔分类 -  django+vue

摘要:父组件 1 <script lang="ts" setup> 2 import { ref } from 'vue' 3 const value = ref({ 4 page: 1, 5 size: 2, 6 selectId : "" 7 }) 8 </script> 9 10 <template 阅读全文
posted @ 2024-10-25 18:02 东方不败--Never 阅读(167) 评论(0) 推荐(0) 编辑
摘要:方法一 1 <el-upload 2 ref="RefUpload" 3 class="avatar-uploader" 4 :auto-upload="false" 5 :show-file-list="false" 6 :on-change="handleChange" 7 > 8 <img v 阅读全文
posted @ 2024-10-25 17:51 东方不败--Never 阅读(135) 评论(0) 推荐(0) 编辑
摘要:import { dayjs } from 'element-plus' export const formatTime = (time) => dayjs(time).format('YYYY年MM月DD日') <el-table-column prop="date" label="Date" w 阅读全文
posted @ 2024-10-24 14:57 东方不败--Never 阅读(91) 评论(0) 推荐(0) 编辑
摘要:一、vue2与Django路由打通配置 main.js 文件 1 const { defineConfig } = require('@vue/cli-service') 2 module.exports = defineConfig({ 3 transpileDependencies: true, 阅读全文
posted @ 2024-10-16 14:45 东方不败--Never 阅读(75) 评论(0) 推荐(0) 编辑
摘要:用dom 获取孙子的属性和方法,但是孙子的属性和方法必须暴露出来 阅读全文
posted @ 2024-10-15 16:30 东方不败--Never 阅读(9) 评论(0) 推荐(0) 编辑
摘要:一、vue3 父子相传 vue3双向绑定的父子相传 v-model="value.selectId" 就等于 v-model:modelValue="value.selectId" 二、vue2 父子相传 三、vue3非父子相传 爷爷 1 const name = ref(0) 2 // 给孙子、孙 阅读全文
posted @ 2024-10-15 11:17 东方不败--Never 阅读(8) 评论(0) 推荐(0) 编辑
摘要:一、vue3 watch 1 import { ref, watch } from 'vue' 2 3 const user = ref({ name: 'zd', age: 22 }) 4 watch( 5 user, // 监视多个参数:[xx1,xx1] 6 (newValue, oldVal 阅读全文
posted @ 2024-10-15 10:08 东方不败--Never 阅读(404) 评论(0) 推荐(0) 编辑
摘要:一、获取公共数据 store/index.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const store = new Vuex.Store({ state: { count: 100, title: 'zd' } 阅读全文
posted @ 2024-09-26 10:51 东方不败--Never 阅读(99) 评论(0) 推荐(0) 编辑
摘要:一、配置vue2路由 router/index.js 1 import Vue from 'vue' 2 import VueRouter from 'vue-router' 3 import MyHeader from '@/components/MyHeader.vue' 4 import My 阅读全文
posted @ 2024-09-25 11:38 东方不败--Never 阅读(12) 评论(0) 推荐(0) 编辑
摘要:一、vue2 # 下载node 、npm nvm install 14.21.3 # 切换国内镜相 npm config set registry=https://registry.npmmirror.com npm i@vue/cli -g vue —version # 创建vue2的项目 vue 阅读全文
posted @ 2024-09-24 15:45 东方不败--Never 阅读(96) 评论(0) 推荐(0) 编辑
摘要:一、局部自定义指令 二、全局注册自定义指令 三、总结 四、传值 el: 代指元素 binding: 代指v-xx的值,用binding.value 来获取值 阅读全文
posted @ 2024-09-23 12:03 东方不败--Never 阅读(16) 评论(0) 推荐(0) 编辑
摘要:一、获取dom 二、获取子组件的方法 三、$nextTick dom执行后,执行$nextTick 阅读全文
posted @ 2024-09-22 10:52 东方不败--Never 阅读(13) 评论(0) 推荐(0) 编辑
摘要:一、组件之间传递 enentBus.js import vue from 'vue' const Bus = new vue() export default Bus MyHeader.vue 消息传递者 sendMs(){ Bus.$emit('sendMsg','小米花') } MyMain.v 阅读全文
posted @ 2024-09-20 19:04 东方不败--Never 阅读(8) 评论(0) 推荐(0) 编辑
摘要:reduce 数组求和 this.list.reduce((sum,item)=>sum+item,0) filter 过滤 this.list.filter(item=>item!=1) toFixed 四舍五入小数点 (this.list[0]).toFixed(2) unshift 添加数组到 阅读全文
posted @ 2024-09-05 11:32 东方不败--Never 阅读(10) 评论(0) 推荐(0) 编辑
摘要:一、具名插槽、默认插槽、插槽传值 name 命名,#接收 插槽默认name 是default 插槽内容必须要 template 标签包裹 二、实例 input 带有前缀图标 1 <el-input 2 class="inputClass" 3 v-model="form.name" 4 ref="n 阅读全文
posted @ 2024-08-26 10:16 东方不败--Never 阅读(158) 评论(0) 推荐(0) 编辑
摘要:npm i tinymce npm i @tinymce/tinymce-vue 3、从node_modules/tinymce 复制样式文件到public 目录下 中文语言包,zh-Hans.js下载地址:https://www.tiny.cloud/get-tiny/language-packa 阅读全文
posted @ 2024-08-21 19:38 东方不败--Never 阅读(97) 评论(0) 推荐(0) 编辑
摘要:一、前端分页 后端将所有数据给前端,前端来实现分页 1 <template> 2 <div class="flex items-center justify-center mt-5"> 3 <el-pagination 4 background 5 v-model:current-page="cur 阅读全文
posted @ 2024-08-20 11:11 东方不败--Never 阅读(780) 评论(0) 推荐(0) 编辑
摘要:一、创建项目 # 下载node 、npm nvm install 16.15.0 # 切换国内镜相 npm config set registry=https://registry.npmmirror.com # 创建项目 npm init vite@latest shop-admin -- --t 阅读全文
posted @ 2024-08-10 08:49 东方不败--Never 阅读(35) 评论(0) 推荐(0) 编辑
摘要:1、创建项目 django-admin startproject StudentV4BE 2、创建APP python3 manage.py startapp student 3、app 的__init__.py 文件下 import pymysqlpymysql.install_as_MySQLd 阅读全文
posted @ 2023-11-29 11:19 东方不败--Never 阅读(27) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示