0.0.5 • Published 8 months ago

element-pro-vue3 v0.0.5

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

element-pro-vue3

组件下载

yarn add element-pro-vue3

全局使用方法

在vue3项目中全局引用的方式

//main.ts or main.js
import { createApp } from 'vue';
import App from './App.vue';
import ElementPro from 'element-pro-vue3';
import 'element-pro-vue3/lib/style.css';

const app = createApp(App);

app.use(ElementPro);
app.mount('#app');

如果使用ts+vite的方式,需要在env.d.ts中加入最后一句声明,否则ts会检测报错。

/// <reference types="vite/client" />
declare module '*.vue' {
  import type { DefineComponent } from 'vue'
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
  const component: DefineComponent<{}, {}, any>
  export default component
}

declare module 'vue3-starry-sky';

组件内使用

<script setup></script>

<template>
	<starry-sky :stars-count="1000" :distance="1000" />
</template>

<style></style>

局部引用方法

示例:

<script setup>
import { StarrySky } from '../packages/index';
</script>

<template>
	<starry-sky :stars-count="1000" :distance="1000" />
</template>

<style></style>

参数说明

属性类型默认值
stars-countNumber800
distanceNumber800

源码地址

相关(vue-starry-sky

本项目基于vite+vue3基于之前的cli+vue2升级改造而来,想访问vue2库组件请点击下面链接地址:

上传教程

npm config set registry https://registry.npmjs.org/
npm login
npm publish
0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago