Comments (3)
I think you can add something like this to your project in a global.d.ts
:
declare module 'vue-material-design-icons/*.vue' {
import type { DefineComponent } from 'vue'
const IconVue : DefineComponent<
{
/// `size` defaults to 24
size: number,
/// `fillColor` defaults to 'currentColor'
fillColor: string,
title?: string,
}>
export default IconVue
}
Should work with vue 2.7 and vue 3
from vue-material-design-icons.
@Howard-Lam-UnitedVanning
I just faced the same problem and got it working by declaring size
and fillcolor
as optional. So the file contents are now
declare module 'vue-material-design-icons/*.vue' {
import type { DefineComponent } from 'vue';
const IconVue: DefineComponent<{
/// `size` defaults to 24
size?: number;
/// `fillColor` defaults to 'currentColor'
fillColor?: string;
title?: string;
}>;
export default IconVue;
}
Calling this file 'global.d.ts' strangely didn't work. It only worked after I prefixed it with 'shims'; now it is called 'shims-vue-mat-icons.d.ts' and sits at project root. This way, things finally work out without errors.
Thanks for your suggestion, @susnux
from vue-material-design-icons.
@susnux I get the following error with your solution in the template
Argument of type '{}' is not assignable to parameter of type '{ readonly size: number; readonly fillColor: string; readonly title?: string | undefined; style?: unknown; key?: string | number | symbol | undefined; ref?: VNodeRef | undefined; ... 8 more ...; class?: unknown; } & Record<...>'.
Type '{}' is missing the following properties from type '{ readonly size: number; readonly fillColor: string; readonly title?: string | undefined; style?: unknown; key?: string | number | symbol | undefined; ref?: VNodeRef | undefined; ref_for?: boolean | undefined; ... 7 more ...; class?: unknown; }': size, fillColor
example : <ChevronUp />
and it shows on ChevronUp
from vue-material-design-icons.
Related Issues (20)
- Missing featured_play_list HOT 2
- Update to Vue3? HOT 12
- Vue3 issue HOT 1
- Build broke with 4.13.0 (sorry, this is a weird report) HOT 15
- Vue3 - multiple compiler errors HOT 5
- Can't import thin icon HOT 4
- [Vue 3] click event fires twice HOT 2
- Missing icons HOT 2
- Support for a single component that receives the icon name as a prop HOT 11
- [Vue 3] warning (deprecation COMPILER_V_BIND_OBJECT_ORDER) HOT 1
- Error on Jest transformation HOT 1
- Missing icons? HOT 3
- Project status HOT 7
- How to pass additional css classes (tailwind) to vue-mdi component HOT 4
- Error when build in docker or gh action `[vite]: Rollup failed to resolve import "vue-material-design-icons/ToolBox.vue" from "/app/src/components/LabelIcon.vue".` HOT 6
- Enhance documentation with style alternatives HOT 3
- When title is missing, should aria-hidden be "false" or default? HOT 5
- 为什么只能import一个Menu.vue,import其他的组件就报vue-material-design-icons不存在 HOT 1
- Multi Import HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-material-design-icons.