Skip to content

Commit

Permalink
fix(playground): remove import about vite and fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
BeADre committed Sep 18, 2022
1 parent c661a3c commit cf261e6
Show file tree
Hide file tree
Showing 7 changed files with 2,601 additions and 537 deletions.
1 change: 1 addition & 0 deletions packages/varlet-eslint-config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module.exports = {
'vue/require-explicit-emits': 'off',
'@typescript-eslint/camelcase': 'off',
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-extra-semi': 'off',
'@typescript-eslint/no-explicit-any': 'off',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@varlet/touch-emulator": "latest"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.4.0",
"@vitejs/plugin-vue": "^3.0.1",
"@vue/compiler-sfc": "^3.2.0",
"vite": "^2.4.4"
"vite": "^3.0.4"
}
}
4 changes: 4 additions & 0 deletions packages/varlet-ui-playground/src/module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module '*?raw' {
const content: string
export default content
}
1 change: 1 addition & 0 deletions packages/varlet-ui-playground/src/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export class ReplStore implements Store {
this.initImportMap()

// varlet inject
// @ts-ignore
this.state.files[varletReplPlugin] = new File(varletReplPlugin, varletReplPluginCode, !import.meta.env.DEV)

watchEffect(() => compileFile(this, this.state.activeFile))
Expand Down
7 changes: 3 additions & 4 deletions packages/varlet-ui-playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import fs from 'fs'
import { resolve } from 'path'
import { defineConfig, Plugin } from 'vite'

const varletESMBundleFile = resolve(__dirname, '../varlet-ui/es/varlet.esm.js')
const varletArea = resolve(__dirname, '../varlet-ui/json/area.json')
const varletTouchEmulatorFile = resolve(__dirname, '../varlet-touch-emulator/index.js')
const varletCSSFile = resolve(__dirname, '../varlet-ui/es/style.css')

function copyVarletPlugin(): Plugin {
function copyVarletPlugin() {
return {
name: 'copy-varlet',
buildStart() {
Expand All @@ -19,7 +18,7 @@ function copyVarletPlugin(): Plugin {
}
}

export default defineConfig(async () => {
export default async () => {
return {
base: './',
plugins: [copyVarletPlugin()],
Expand All @@ -31,4 +30,4 @@ export default defineConfig(async () => {
outDir: 'site',
},
}
})
}
8 changes: 4 additions & 4 deletions packages/varlet-ui/src/style-provider/docs/zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ const toggleRootTheme = () => {

### 属性

| 参数 | 说明 | 类型 | 默认值 |
|--------------| --- |--------------------------| -- |
| `style-vars` | css 变量 | _Record<string, string>_ | `{}` |
| `tag` | 自定义标签名 | _string_ | `div` |
| 参数 | 说明 | 类型 | 默认值 |
|--------------|---------------|--------------------------|---------|
| `style-vars` | CSS 变量 | _Record<string, string>_ | `{}` |
| `tag` | 自定义标签名 | _string_ | `div` |

### 插槽

Expand Down
Loading

0 comments on commit cf261e6

Please sign in to comment.