Coder Social home page Coder Social logo

sonofmagic / uni-app-vite-vue3-tailwind-vscode-template Goto Github PK

View Code? Open in Web Editor NEW
133.0 2.0 23.0 1.53 MB

uni-app vue3 tailwindcss 模板,集成了 iconify,eslint,typescript,prettier 等等工具作为解决方案

License: MIT License

HTML 5.53% Vue 55.47% TypeScript 11.72% JavaScript 27.29%
iconify tailwindcss template typescript uni-app vite vue vue3

uni-app-vite-vue3-tailwind-vscode-template's Introduction

uni-app-vite-vue3-tailwind-vscode-template

基于 uni-appvite/vue3 tailwindcss 模板

假如你觉得好用,欢迎给我的 weapp-tailwindcss 点个 Star 吧。

官网地址: https://weapp-tw.icebreaker.top/

特性

快速开始

使用 vscode 的朋友,请先安装 Tailwind CSS IntelliSense 智能提示与感应插件

其他 IDE 请参考: https://weapp-tw.icebreaker.top/docs/quick-start/intelliSense

本项目已经集成 weapp-ide-cli 可以通过 cliide 进行额外操作,详细信息

单位转换

  • rem->rpx (默认开启, uvtwrem2rpx 选项)
  • px -> rpx (默认不开启,可反注释 postcss.config.cjs 中的 postcss-pxtransform 开启配置)

Tips

  • 升级 uni-app 依赖的方式为 npx @dcloudio/uvm 后,选择对应的 Package Manager 即可。而升级其他包的方式,可以使用 yarn upgradeInteractive --latest,这个是 yarn 自带的方式。

之前使用 pnpm 进行安装的时候,一直有 bug 导致控件库无法加载运行,如果发现 pnpm 好了可以 issue 里通知一声

uni-app-vite-vue3-tailwind-vscode-template's People

Contributors

sonofmagic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

uni-app-vite-vue3-tailwind-vscode-template's Issues

运行命令npm run dev:h5:ssr,报错

运行命令npm run dev:h5:ssr,报错
错误信息如下:
uni --ssr

请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
正在编译中...
error when starting dev server:
Error: Failed to resolve vue/compiler-sfc.
@vitejs/plugin-vue requires vue (>=3.2.25) to be present in the dependency tree.

运行环境
node: 14.19.3
yarn: 3.4.1

[eslint error] in vite.config.ts

描述这个Bug
vite.config.ts 文件中, eslint报错(用eslint来处理ts error)

Require statement not part of import statement.eslint@typescript-eslint/no-var-requires

屏幕截图(可选)
image

其实直接import导入就行了

import autoprefixer from 'autoprefixer';
import tailwindcss from 'tailwindcss';
import rem2px from 'postcss-rem-to-responsive-pixel';

const postcssPlugins = [autoprefixer(), tailwindcss()];
if (!WeappTailwindcssDisabled) {
  postcssPlugins.push(
    rem2px({
      rootValue: 32,
      propList: ['*'],
      transformUnit: 'rpx',
    }),
  );
}

在我这边是可以, 你可以再验证下
Thx

PS: 这个库很不错, 查了很多uniapp集成tailwindcss的方案, 这个库最靠谱

hover-class 下的 dark 模式失效

<view class="bg-gray-100 dark:bg-zinc-800" hover-class="bg-red-500 dark:bg-green-500"></view>

编译后

<view class="bg-gray-100 dark_c_bg-zinc-800" hover-class="bg-red-500 dark:bg-green-500"></view>

hover-class 里的 dark:bg-green-500 没有编译

编译成小程序后webview标签消失了?

<template> <div class='page'> <web-view :webview-styles="color" src="https://h5.eventnet.cn/html/xxx.html?v=1.11"></web-view> </div> </template>
编译小程序后webview标签消失了,没弄明白是什么原因。还有就是pnpm可以用了。

真机测试爆红

image

请问这种情况是正常的吗?

直接clone的仓库 webstorm打开 yarn install 初始化 yarn run dev:mp-weixin 启动,开发工具里是正常的,真机出现这个错误,不影响页面显示。

请教uni模版中如何配置customAttributes?

作者大大好,我想使用比如group-hover-class属性,参考了这个 https://github.com/sonofmagic/weapp-native-mina-tailwindcss-template/issues/3链接内的配置,

export default defineConfig({
  // uvtw 一定要放在 uni 后面
  plugins: [
    uni(),
    uvtw({
      customAttributes: {
        '*': ['group-hover-class']
      },
      disabled: WeappTailwindcssDisabled
    }),
...

但似乎没有生效

<view class="flex-1 group" group-hover-class="!bg-indigo-500 !text-red">
...
</view>

请问是哪里搞错了吗?

yarn dev:app报错

nodejs版本:v18.16.1
启动app模式报错:

[plugin:vite-plugin-uni-app-weapp-tailwindcss-adaptor] Cannot read properties of undefined (reading 'length')

h5没问题

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.