1.0.0 • Published 5 months ago

@plugin-light/webpack-loader-vue-directive v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

转换 Vue 指令

替换 Vue 模板中的指令,如:

 <div
  v-treport="actshowcolumn.treport"
  class="tip-act-welfare-top"
  @click.stop="onClick"
>

<!-- 将转为 -->
 <div
  class="tip-act-welfare-top"
  @click.stop="onClick"
>

如何使用

安装

pnpm add @plugin-light/webpack-loader-vue-directive -D

vue.config.js 中添加如下设置:

const { LOADER: vueDirective } = require('@plugin-light/webpack-loader-vue-directive');

module.export = {
  chainWebpack(config) {
    config.module
      .rule('vue')
      .test(/\.vue$/)
      .use(vueDirective)
      .loader(vueDirective)
      .options({
        list: ['treport'],
      })
      .end();
  }
}

参数

export type IVueDirectionOptions = {
  // 待处理的指令列表
  list?: Array<string>;
};

更新日志

点此查看

1.0.0

5 months ago

0.0.8

1 year ago