How to use the defineComponent function from vue

Find comprehensive JavaScript vue.defineComponent code examples handpicked from public code repositorys.

1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
        this.render.destroy();
        this.select.destroy();
    }
}


var script = vue.defineComponent({
    name: 'SlimSelect',
    props: {
        modelValue: {
            type: [String, Array, undefined],
fork icon167
star icon856
watch icon18

+ 4 other calls in file

10
11
12
13
14
15
16
17
18
19
  const app = createSSRApp({ render: () => h(Component.default, props, slots) });
  const html = await renderToString(app);
  return { html, css: undefined };
};

const SlotWrapper = defineComponent({
  props: {
    value: String,
  },
  setup({ value }) {
fork icon38
star icon441
watch icon6

+ 3 other calls in file

101
102
103
104
105
106
107
108
109
110
}

script.render = render;
script.__file = "packages/tabs/src/tab-bar.vue";

var script$1 = vue.defineComponent({
  name: 'OElTabNav',
  components: {
    TabBar: script,
  },
fork icon3
star icon8
watch icon3

+ 7 other calls in file

31
32
33
34
35
36
37
38
39
40
const elFormEvents = {
    addField: 'el.form.addField',
    removeField: 'el.form.removeField',
};

var LabelWrap = vue.defineComponent({
    name: 'ElLabelWrap',
    props: {
        isAutoWidth: Boolean,
        updateAll: Boolean,
fork icon1
star icon2
watch icon1

+ 3 other calls in file

47
48
49
50
51
52
53
54
55
56

function createNamespace(name) {
  return `EASI${name}`;
}

var script$5 = _vue.defineComponent({
  name: createNamespace("menu"),
  props: {
    collapsed: {
      type: Boolean,
fork icon1
star icon1
watch icon4

+ 7 other calls in file

117
118
119
120
121
122
123
124
125
126
127


const _hoisted_1 = { class: "v-code-block--button-copy" };
const _hoisted_2 = { class: "v-code-block--button-run" };
const _hoisted_3 = { class: "v-code-block--code" };
const _hoisted_4 = ["innerHTML"];
var _sfc_main = /*#__PURE__*/ vue.defineComponent({
    __name: 'CodeBlock',
    props: {
        browserWindow: {
            type: Boolean,
fork icon0
star icon1
watch icon1

18
19
20
21
22
23
24
25
26
27
28


const _withScopeId = n => (vue.pushScopeId("data-v-7d8ba791"), n = n(), vue.popScopeId(), n);
const _hoisted_1$1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/ vue.createElementVNode("path", { d: "M224 0c-35.3 0-64 28.7-64 64V288c0 35.3 28.7 64 64 64H448c35.3 0 64-28.7 64-64V64c0-35.3-28.7-64-64-64H224zM64 160c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H288c35.3 0 64-28.7 64-64V384H288v64H64V224h64V160H64z" }, null, -1 /* HOISTED */));
const _hoisted_2$1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/ vue.createElementVNode("path", { d: "M470.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L192 338.7 425.4 105.4c12.5-12.5 32.8-12.5 45.3 0z" }, null, -1 /* HOISTED */));
const _hoisted_3$1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/ vue.createElementVNode("path", { d: "M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3 265.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256 310.6 150.6z" }, null, -1 /* HOISTED */));
var _sfc_main$1 = /*#__PURE__*/ vue.defineComponent({
    __name: 'StatusIcons',
    props: {
        icon: {
            type: String,
fork icon0
star icon1
watch icon1

+ 11 other calls in file

37
38
39
40
41
42
43
44
45
46
    id: id,
    visibility: 'hidden',
    ref: elementRef
  })
}
exports.Editor = vue_1.defineComponent({
  props: EditorPropTypes_1.editorProps,
  setup: function (props, ctx) {
    var _a = vue_1.toRefs(props),
      disabled = _a.disabled,
fork icon0
star icon0
watch icon1

2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
        isActive,
        isExactActive,
        navigate,
    };
}
const RouterLinkImpl = /*#__PURE__*/ vue.defineComponent({
    name: 'RouterLink',
    props: {
        to: {
            type: [String, Object],
fork icon0
star icon0
watch icon1

+ 23 other calls in file

754
755
756
757
758
759
760
761
762
763
764
}
function useActiveMeta() {
    return vue.inject(metaActiveKey);
}


const MetainfoImpl = vue.defineComponent({
    name: 'Metainfo',
    inheritAttrs: false,
    setup(_, { slots }) {
        return () => {
fork icon0
star icon0
watch icon1

+ 3 other calls in file

2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
  }]);
  return Parser;
}();


var _hoisted_1$b = ["href", "title"];
var script$e = /*#__PURE__*/ vue.defineComponent({
    __name: 'Link',
    props: {
        href: { type: String, required: true },
        title: { type: String, required: false }
fork icon0
star icon0
watch icon1

+ 89 other calls in file