Skip to content

Commit

Permalink
add demo from figma plugin example
Browse files Browse the repository at this point in the history
  • Loading branch information
tony19 committed Oct 17, 2021
1 parent d65158b commit 463b96c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
// This starter template is using Vue 3 <script setup> SFCs
// Check out https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup
import HelloWorld from './components/HelloWorld.vue'
import RectangleCreatorDemo from './components/RectangleCreatorDemo.vue'
</script>

<template>
<img alt="Vue logo" src="./assets/logo.png" />
<HelloWorld msg="Hello Vue 3 + TypeScript + Vite" />
<RectangleCreatorDemo />
</template>

<style>
Expand Down
19 changes: 19 additions & 0 deletions src/components/RectangleCreatorDemo.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<script setup lang="ts">
import { ref } from 'vue'
const count = ref(0)
const create = () => {
parent.postMessage({ pluginMessage: { type: 'create-rectangles', count: count.value } }, '*')
}
const cancel = () => {
parent.postMessage({ pluginMessage: { type: 'cancel' } }, '*')
}
</script>

<template>
<h2>Rectangle Creator</h2>
<p>Count: <input id="count" v-model="count"></p>
<button @click="create">Create</button>
<button @click="cancel">Cancel</button>
</template>

0 comments on commit 463b96c

Please sign in to comment.