Skip to content

Latest commit

 

History

History
65 lines (51 loc) · 1.06 KB

README.md

File metadata and controls

65 lines (51 loc) · 1.06 KB

vite-plugin-custom-attr

📖 Introduction

Set default values for tags.

📦 Installation

# vite-plugin-custom-attr

pnpm install vite-plugin-custom-attr -D

🦄 Usage

// for Vue3

import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import CustomProps from 'vite-plugin-custom-attr/vite'

export default defineConfig({
  plugins: [
    Vue(), 
    CustomProps({
      tags: {
        'el-input': {
          clearable: true
        },
        "h1" : {
          style: "font-size: 2rem;"
        },
        "el-button" : {
          type: "success",
          plain: true,
        }, 
      }
    })
  ],
})
<template>
  <el-input v-model="input" />
  <h1>change style</h1>
  <el-button>no type</el-button>
  <el-button type="primary">type primay</el-button>
</template>

to

<template>
  <el-input v-model="input" clearable />
  <h1 style="font-size: 2rem;">change style</h1>
  <el-button type="success" plain>no type</el-button>
  <el-button type="primary" plain>type primay</el-button>
</template>