1.0.10 • Published 4 months ago

g6-ui v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

快速入门


下载依赖

npm i g6-ui -S
or
yarn add g6-ui -S

项目中使用

全局引入

import { createApp } from 'vue'
import App from './App.vue'
import GUI from 'g6-ui'
import 'g6-ui/es/style.css'

const app = createApp(App)
app.use(GUI).mount('#app')
<template>
  <g-select-time></g-select-time>
</template>
<script setup lang="ts"></script>
<style lang="less" scoped></style>

按需引入

import { createApp } from 'vue'
import App from './App.vue'
import 'g6-ui/es/style.css'

const app = createApp(App)
app.mount('#app')
<template>
  <g-select-time></g-select-time>
</template>
<script setup lang="ts">
import { GSelectTime } from 'g6-ui'
</script>
<style lang="less" scoped></style>

常见问题

问题:在全局引入时会丢失类型提示
方案:在tsconfig.json中添加components.d.ts文件,代码如下:

// tsconfig.json
{
  "compilerOptions": {
    ...
  },
  "include": ["...其他配置...", "components.d.ts"],
}
// components.d.ts
import "@vue/runtime-core";
declare module "@vue/runtime-core" {
  export interface GlobalComponents {
    GButton: typeof import("g6-ui")["GButton"];
    GSelectTime: typeof import("g6-ui")["GSelectTime"];
    ...
  }
}
export {};

问题:下载出错
方案:切换下载源多试几次

1.0.9

4 months ago

1.0.10

4 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago