Skip to content

xxholly32/vite-plugin-custom-attr

Repository files navigation

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>

About

Set default values for tags.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published