[Feature] Refer to component by ID instead whole file by ID
See original GitHub issueIt should become possible to refer to a Figma component with the <Figma></Figma>
Vue.js component.
For instance we have these three Figma components:
On each I should be able to use the component name (or a custom id via the figma-low-code plugin). I should then be able to refere to this component like this for example:
Example:
<Figma :figma="figmaConfig" component="Btn-Single-Sign-On-Google"></Figma>
At the moment I can only refer to the WHOLE file. That is not sufficient since I want to reuse single components. One could now say that Figma components already handles the “reusability” and there is no need to bring this into Vue.js component.
However the idea is to work with that like this: Creating a component only refering to the Figma component not the whole Figma file…
ui/buttons/single-sign-on.vue
<template>
<div>
<Figma :figma="figmaConfig" component="Btn-Single-Sign-On-Google" v-model="viewModel"></Figma>
</div>
</template>
<script>
export default {
name: 'SingleSignOn',
data: function () {
return {
figmaConfig: {
figmaFile: '<file-id>',
figmaAccessKey: '<access-key>'
},
viewModel: {
}
}
}
}
</script>
… and the using the Custom
component feature of the figma-low-code plugin to refer to this inside another component.
And this Button 1
Figma component I can then refer again in a Vue.js component like this:
ui/groups/login.vue
<template>
<div>
<Figma :figma="figmaConfig" component="Group-1" v-model="viewModel"></Figma>
</div>
</template>
<script>
export default {
name: 'Login',
data: function () {
return {
figmaConfig: {
figmaFile: '<file-id>',
figmaAccessKey: '<access-key>'
},
viewModel: {
}
}
}
}
</script>
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (9 by maintainers)
Hi, the first version of the design system is ready to try:
https://github.com/KlausSchaefers/vue-low-code#Designlet-Mode
The documentation is for Quant-UX but for Figma it works basically the same. Please note that I only import elements (components or not) that are direct children of a root artboard.
<MyButton /> <MyButton>Hello World</MyButton>
Thanks again for the idea! All feedback is welcome!
oh exciting! Will take a look in a few! Can you link the commits here so I might take a look how you managed to do it?