WIP DOCS: https://datav-vue3.jiaminghi.com
datav-team / datav-vue3 Goto Github PK
View Code? Open in Web Editor NEWWIP: DataV Vue3 + Vite + TypeScript
Home Page: https://datav-vue3.jiaminghi.com/
License: MIT License
WIP: DataV Vue3 + Vite + TypeScript
Home Page: https://datav-vue3.jiaminghi.com/
License: MIT License
WIP DOCS: https://datav-vue3.jiaminghi.com
这个库不更新了吗?
Vue3好久了, 用了几个第三方开发者改的好难用, 等新版本发布咯
caught (in promise) TypeError: Cannot read properties of null (reading '$el')
at ref (index.mjs:44:33)
at callWithErrorHandling (runtime-core.esm-bundler.js:155:22)
at setRef (runtime-core.esm-bundler.js:4523:9)
at unmount (runtime-core.esm-bundler.js:6067:13)
at unmountComponent (runtime-core.esm-bundler.js:6196:13)
at unmount (runtime-core.esm-bundler.js:6081:13)
at unmountChildren (runtime-core.esm-bundler.js:6225:13)
at unmount (runtime-core.esm-bundler.js:6099:17)
at patch (runtime-core.esm-bundler.js:5054:13)
at patchBlockChildren (runtime-core.esm-bundler.js:5390:13)
r
环境:webpack+vue3+ts
在main.ts文件中引入并挂载
import DataV from "@dataview/datav-vue3";
...
app.use(router).use(DataV, { classNamePrefix: "dv-" });
有错误提示,运行时报错不能通过:
import DataV
没有与此调用匹配的重载。
第 1 个重载(共 2 个),“(plugin: Plugin_2<[{ classNamePrefix: string; }]>, options_0: { classNamePrefix: string; }): App”,出现以下错误。
类型“typeof import("d:/workspace/study/dashboard/node_modules/@dataview/datav-vue3/es/index")”的参数不能赋给类型“Plugin_2<[{ classNamePrefix: string; }]>”的参数。
第 2 个重载(共 2 个),“(plugin: Plugin_2<{ classNamePrefix: string; }>, options: { classNamePrefix: string; }): App”,出现以下错误。
类型“typeof import("d:/workspace/study/dashboard/node_modules/@dataview/datav-vue3/es/index")”的参数不能赋给类型“Plugin_2<{ classNamePrefix: string; }>”的参数。ts(2769)
使用npm 安装包以后引用报错
Internal server error: Failed to resolve entry for package "@dataview/datav-vue3". The package may have incorrect main/module/exports specified in its package.json.
BorderBox2,BorderBox5使用UMD方式引入不显示
Decoration10,Decoration11,Decoration12使用UMD方式引入报错
<script setup> const { createApp } = Vue const { BorderBox1,BorderBox2,BorderBox3,BorderBox4,BorderBox5,BorderBox6,BorderBox7,BorderBox8,BorderBox9,BorderBox10,BorderBox11,BorderBox12,BorderBox13,Decoration1,Decoration2,Decoration3,Decoration4,Decoration5,Decoration6,Decoration7,Decoration8,Decoration9,Decoration10,Decoration11,Decoration12 } = DataV const app = createApp({ }) app.component('BorderBox1', BorderBox1) .component('BorderBox2', BorderBox2) .component('BorderBox3', BorderBox3) .component('BorderBox4', BorderBox4) .component('BorderBox5', BorderBox5) .component('BorderBox6', BorderBox6) .component('BorderBox7', BorderBox7) .component('BorderBox8', BorderBox8) .component('BorderBox9', BorderBox9) .component('BorderBox10', BorderBox10) .component('BorderBox11', BorderBox11) .component('BorderBox12', BorderBox12) .component('BorderBox13', BorderBox13) .component('Decoration1', Decoration1) .component('Decoration2', Decoration2) .component('Decoration3', Decoration3) .component('Decoration4', Decoration4) .component('Decoration5', Decoration5) .component('Decoration6', Decoration6) .component('Decoration7', Decoration7) .component('Decoration8', Decoration8) .component('Decoration9', Decoration9) .component('Decoration10', Decoration10) .component('Decoration11', Decoration11) .component('Decoration12', Decoration12) app.mount('#app') </script>
一大堆问题,如果vue3想要用dataV的可以先看看这个https://datav-vue3.netlify.app/ 这个亲测效果会更好点,或者先用vue2的版本
版本如下:
"vue": "3.2.45"
"vite": "3.2.3"
"@dataview/datav-vue3": "^0.0.0-test.1672506674342"
Internal server error: Failed to resolve entry for package "@dataview/datav-vue3". The package may have incorrect main/module/exports specified in its package.json.
vite+vue3很好用,希望更新Loading组件
1.使用了BorderBox组件的页面,卸载时必会出现Cannot read properties of null (reading '$el')错误;
2. 因此,在使用v-if销毁页面或者keepalive移除缓存页面时,都会出现此问题;
3. 定位到原因可能是getRefDom方法未对入参ref进行非空判断,因为在上面的1、2情况下,ref的值会是null;
4. 如果是单独的大屏,没有离开页面的情形,自然不会出现上述情形;
5. 希望作者能够看到,感谢作者的付出!
ERROR 12:27:46 AM [vite] Internal server error: Failed to resolve entry for package "@dataview/datav-vue3". The package may have incorrect main/module/exports specified in its package.json
改成import DataV from '@dataview/datav-vue3/es';后报另一个错:
The requested module '/node_modules/.vite/deps/@dataview_datav-vue3_es.js?v=baca4c47' does not provide an export named 'default
package.json导出字段与实际打包后的文件路径不一致,导致使用时报错,package.json中"main": "./cjs/index.js","module": "./es/index.js",但是实际打包后文件夹只有es/index.mjs和umd/datav.umd.js
大佬别闲着,生产队都开工了!!!
resolve entry for package "@dataview/datav-vue3". The package may have incorrect main/module/exports specified in its package.json.
16:25:56 [vite] Internal server error: Failed to resolve entry for package "@dataview/datav-vue3". The package may have incorrect main/module/exports specified in its package.json.
Plugin: vite:import-analysis
Module not found: Error: Can't resolve '@dataview/datav-vue3'
添加完依赖后运行不起来;
解决方法:在"@dataview/datav-vue3"的package.json文件加入"type": "module";
使用的是按需引入,页面显示正常,跳转到其他页面,vue-router 报错
<script setup lang="ts">
import { BorderBox1, BorderBox10, BorderBox13, BorderBox3, BorderBox4 } from '@dataview/datav-vue3/es'
</script>
<template>
<div wfull h100vh bg="[#17171A]" text-white>
<BorderBox1>
<div grid="~ cols-7 rows-3 gap2" p20px pr15px h720px>
<div col-span-2 row-span-3>
<BorderBox10>
<div flex-center hfull>
1
</div>
</BorderBox10>
</div>
<div col-span-3 row-span-2>
<BorderBox3>
1
</BorderBox3>
</div>
<div col-span-2 row-span-1>
<BorderBox13>
1
</BorderBox13>
</div>
<div col-span-2 row-span-1>
<BorderBox13>
1
</BorderBox13>
</div>
<div col-span-5 row-span-1>
<BorderBox4>
1
</BorderBox4>
</div>
</div>
</BorderBox1>
</div>
</template>
能否导出 hook 和 utils,以方便基于此封装组件
包下载需要手动改
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.