bestvue3 / vue-jss Goto Github PK
View Code? Open in Web Editor NEWjss support for vue
jss support for vue
不能将类型“{ className: string; }”分配给类型“ElementAttrs”。
类型“ElementAttrs”上不存在属性“className”。ts(2322)
how to fix it
默认classNamePrefix为undefined
在传递时代码中
context.classNamePrefix += classNamePrefix
导致拼接上undefined字符串
如何配合pxtorem使用呢
I have such code in my theme.ts
file.
export interface Theme {
spacing: (n: number) => string;
}
const theme: Theme = {
spacing: (factor) => `${0.25 * factor}rem`,
};
export default theme;
It's ok to get theme type definition by
import { Theme } from '@/constants/theme';
const useStyle = createUseStyles<Theme>(theme => ({ ... });
But it's annoying that I have to import Theme every time.
The useTheme
will lead to type error.
const theme: Ref<Theme> = useTheme();
// Type 'Ref<{}>' is not assignable to type 'Ref<Theme>'.
Is there a similar way to define a global theme like in react-jss
? (https://github.com/cssinjs/jss/blob/master/docs/react-jss-ts.md#defining-a-global-default-theme)
Thanks in advance.
老师你好,之前看过你的课程。
使用过程中有一些问题,做个说明。
1.vue-jss安装完之后,不能使用,还需要安装jss,以及jss-preset-default。
2.redeme文档中的margin: { top: 10 } 写法会报错,直接用字符串写法没有问题margin: "0 20px"
3.在 setup中直接使用const classes = useStyles(); classes需要加value,但是redeme中并没有,如在render函数中使用需要加this
First, congrats by this lib :)
Have a question. This lib supports only vue 3?
Thankyou
Hello, now I want to define an animation keyframe, I didn't find any way to resolve this problem, what should I do?
I watched your extraodinary courses on immoc so I enduring use this library
tip: If this lib no longer maintain, whether have other the same effect lib?
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.