摘要:主要表现在 左右滚动的时候会有数据漏出来,需要使用css控制一下 ::v-deep .el-table__body-wrapper, ::v-deep .el-table__header-wrapper{ border: 1px solid transparent; } /* 去掉表格整体左边和上边
阅读全文
随笔分类 - vue
关于vue的一下方法
摘要:背景: 在vue中,使用watch监听pinia中的数据是否变化来调用api watch(() => { return [ pinia.data, ] }, (newV, oldV) => { axios.get('a.b', params).then((response) => { .... ..
阅读全文
摘要:在进页面前可能需要初始化一些请求数据,用于后续的数据请求 传统的做法是在mounted中嵌套请求方法来请求数据 在vue3 中 我们可以使用 beforeRouteEnter <script lang="ts"> export default { async beforeRouteEnter(to:
阅读全文
摘要:<template> <div> <el-button @click="openMessageBox">打开MessageBox</el-button> <el-button @click="updateMessageBoxContent">打开MessageBox</el-button> </di
阅读全文
摘要:vNode 只是用来描述DOM,自身不维护状态,messageBox只是利用vNode渲染DOM,要想实现messageBox内容响应式,需要提供Vue实例(组件): 写一个这样的组件 新建组件(customRadioGroup.js): import Vue from "vue"; const C
阅读全文
摘要:最近vue2遇到的问题 有一个数据结构是多层嵌套 var level1list = [ { name: 'level1-1', level2List:[ { name: 'level2-1', level3List:[ { name: 'level3-1', value: '' }, { name:
阅读全文
摘要:<script setup lang="ts"> import { useStore } from '@/vuex'; import {computed} from 'vue' const store = useStore() const onSubmit = () => { store.dispa
阅读全文
摘要:<template> <div class="drag-ball" ref="dragBall" @mousedown.stop.prevent="mousedown" @mouseup.stop.prevent="mouseup"> <div class="drag-content"> <slot
阅读全文
摘要:import Vue from 'vue'; import VueI18n from 'vue-i18n'; import stroe from './store' import en from '../en'; import zh from '../cn'; Vue.use(VueI18n); c
阅读全文
摘要:rules: { name: [ { required: true, validator: (rule, value, callback) => { if (!value) { return callback(new Error("请输入名称")); }else{ //这个else 一定要写, 要不
阅读全文
摘要:image.vue <template> <transition name="viewer-fade"> <div ref="bigImg" class="bigImg" v-show="visible"> <div class="back_mask"></div> <span class="big
阅读全文
摘要:return createElement( 'h' + this.level, [ createElement('a', { attrs: { name: headingId, href: '#' + headingId }, style: { color: 'red', }, 'class': {
阅读全文
摘要:import Vue from 'vue' import Vuex from 'vuex' import axaios from 'axios' import createPersistedState from "vuex-persistedstate" //将数据持久化, 此方法就是将store中
阅读全文
摘要:在组件的index.js文件中export出组件 组件 import Component from './Component ' const MyComponent= { install: function(Vue){ Vue.component('MyComponent',Component )
阅读全文
摘要:import axios from 'axios'; import router from '../router' axios.interceptors.request.use( config => { if (localStorage.getItem("token")) { //统一将token带
阅读全文