]> git.jsancho.org Git - vanzui.git/blobdiff - src/components/VSelector.vue
Add components to canvas
[vanzui.git] / src / components / VSelector.vue
diff --git a/src/components/VSelector.vue b/src/components/VSelector.vue
new file mode 100644 (file)
index 0000000..545c99f
--- /dev/null
@@ -0,0 +1,40 @@
+<template>
+  <b-button-group>
+    <b-button
+      v-for="(item, index) in items"
+      :key="index"
+      @click="selectItem(item.tag)"
+    >
+      {{ item.caption }}
+    </b-button>
+  </b-button-group>
+</template>
+
+<script>
+export default {
+  name: "VSelector",
+  data() {
+    return {
+      items: [
+        {
+          tag: "b-form-input",
+          caption: "Form Input",
+        },
+        {
+          tag: "b-form-radio",
+          caption: "Form Radio",
+        },
+        {
+          tag: "b-form-select",
+          caption: "Form Select",
+        },
+      ],
+    };
+  },
+  methods: {
+    selectItem(tag) {
+      this.$emit("select", tag);
+    },
+  },
+};
+</script>