Closed wuchaoxin closed 1 year ago
我本地新建项目使用没有 vue3-slide-verify@1.1.4
样式没有问题,你能提供一下你使用地方的代码片段吗?这样方便排查问题所在。谢谢!
我本地新建项目使用没有
vue3-slide-verify@1.1.4
样式没有问题,你能提供一下你使用地方的代码片段吗?这样方便排查问题所在。谢谢!
你可以在一个空的项目进行下载vue3-slide-verify
,复现流程:
npm init -y
npm i vue3-slide-verify
样式上加了 hash值时没有问题的。 因为写插件的时候style 上加了 scoped ,所以打包出来的样式上会有 hash值。这样可以避免类冲突。但是不影响使用的。
依然不知道你的具体问题是什么。
vue3-slide-verify
可以参见下这个链接:https://codesandbox.io/s/blissful-pare-fyj8eo?file=/src/App.vue
加上这个就好了
<script>
import SlideVerify from "vue3-slide-verify";
import { defineComponent } from "vue";
import "vue3-slide-verify/dist/style.css";
export default defineComponent({
components: { SlideVerify },
});
</script>
加上这个就好了
<script> import SlideVerify from "vue3-slide-verify"; import { defineComponent } from "vue"; import "vue3-slide-verify/dist/style.css"; export default defineComponent({ components: { SlideVerify }, }); </script>
欧,看来是的,在这个 DEMO 这样解决了。在我自己的项目中,这样也不行,似乎是什么影响了 hash 值,我手动移除了 hash 值可以使用。
问题:按照 README 给出提示进行运行 DEMO,发现样式总是缺失。手动引入了下 dist 下的 style 文件,依旧不生效。
原因:格式化 css 文件后发现产出 css 带入了 hash 值。
期望:样式能够正常显示