碰到的一些问题

109 阅读1分钟

引入 ttc 字体文件

//把ui 给的字体引入 project-font.css@font-face {
  font-family: 'PingFang';
  src: url('./project-font/PingFang.ttc') format('truetype');
}
//把 project-font.css 文件引入 index.scss
@import '../font/project-font.css'; // 项目字体

// 把 index.scss 引入 main.js
import '@/assets/css/index.scss'

//下载 file-loader
module.exports = {
    module: {
       rules: [{ test: /\.ttc$/, use: 'file-loader' }]
    }
}

v-html img 超过 div

v-htmlimg 超过 div     css不好使,只能替换

<div class="VHtmlImg" v-html="info?.planExplain"></div>

this.info.planExplain = item.planExplain.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');

a-tree-select 多选搜索 中文

    <template>
        <a-tree-select
          v-model="groups"
          :allowClear="true"
          :treeData="messageForm.treeData"
          searchPlaceholder="请选择号码组"
          style="width: 100%;max-height:300px;overflow:auto"
          treeCheckable
          multiple
          tree-node-filter-prop="title"
          showSearch
         @select="select(item)" 
         :searchValue.sync="item.searchValue"  
         @change="(tissue)=>{change(item)}"
        />
    </template>
     data() {
        return {
          item:{
            searchValue:''
          }
        }
     }
      methods: {
        select(item){
            item.searchValueItem = item.searchValue;
        },
        change(item,tissue) {
            item.searchValue = item.searchValueItem;
        }
    }

vue 页面刷新,但是浏览器不刷新

<template>
  <div id="app" class="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>
export default {
  data() {
    return {
      isRouterAlive: true
    }
  },
  provide(){
    return{
           reload:this.reload
    }
  },
  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(() => {
        this.isRouterAlive = true;
      });
    },
  },
 }
 
 需要刷新得路由
inject: ["reload"]
刷新调用得方法
this.reload()