vue-encyclopedia
Version:
## Project setup ``` npm install ```
123 lines (102 loc) • 3.65 kB
JavaScript
(function (exports, vue) {
'use strict';
var script$1 = {
name: "EnButton",
props: {
title: String,
small: Boolean,
icon: String,
iconsLeft: String,
iconsRight: String,
type: {
default: "primary",
},
},
};
var _hoisted_1$1 = { key: 1 };
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
return (vue.openBlock(), vue.createElementBlock("button", {
class: vue.normalizeClass($props.small ? 'button-' + $props.type + '--small' : 'button-' + $props.type + '--regular')
}, [
($props.iconsLeft)
? (vue.openBlock(), vue.createElementBlock("i", {
key: 0,
class: vue.normalizeClass(["icon-left", $props.iconsLeft])
}, null, 2 /* CLASS */))
: vue.createCommentVNode("v-if", true),
($props.title)
? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1$1, vue.toDisplayString($props.title), 1 /* TEXT */))
: vue.createCommentVNode("v-if", true),
($props.iconsRight)
? (vue.openBlock(), vue.createElementBlock("i", {
key: 2,
class: vue.normalizeClass(["icon-right", $props.iconsRight])
}, null, 2 /* CLASS */))
: vue.createCommentVNode("v-if", true),
($props.icon)
? (vue.openBlock(), vue.createElementBlock("i", {
key: 3,
class: vue.normalizeClass(["icon", $props.icon])
}, null, 2 /* CLASS */))
: vue.createCommentVNode("v-if", true)
], 2 /* CLASS */))
}
script$1.render = render$1;
script$1.__file = "src/components/button/EnButton.vue";
var script = {
name: "EnCard",
props: {
title: String,
icon: String,
},
};
var _hoisted_1 = { class: "card-container" };
var _hoisted_2 = { class: "card-header" };
var _hoisted_3 = { class: "card-title" };
function render(_ctx, _cache, $props, $setup, $data, $options) {
return (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
vue.createElementVNode("div", _hoisted_2, [
vue.createElementVNode("p", _hoisted_3, vue.toDisplayString($props.title), 1 /* TEXT */),
($props.icon)
? (vue.openBlock(), vue.createElementBlock("i", {
key: 0,
class: vue.normalizeClass(["icon", $props.icon])
}, null, 2 /* CLASS */))
: vue.createCommentVNode("v-if", true)
]),
vue.renderSlot(_ctx.$slots, "default", { class: "card-content" })
]))
}
script.render = render;
script.__file = "src/components/card/EnCard.vue";
// Importation de notre composant Vue
// Déclaration de la méthode d'installation utilisée via Vue.use(...)
function install(Vue) {
if (install.installed) { return; }
install.installed = true;
Vue.component("EnButton", script$1);
Vue.component("EnCard", script);
}
// Création du module à destionation Vue.use(...)
var plugin = {
install: install,
};
// Installation automatique si Vue est détecté (par exemple dans un navigation via la balise <script>)
var GlobalVue = null;
if (typeof window !== "undefined") {
GlobalVue = window.Vue;
} else if (typeof global !== "undefined") {
GlobalVue = global.Vue;
}
if (GlobalVue) {
GlobalVue.use(plugin);
}
// Exporter en tant que module (pour npm/webpack/etc.)
var wrapper = {
EnButton: script$1,
EnCard: script,
};
exports["default"] = wrapper;
exports.install = install;
Object.defineProperty(exports, '__esModule', { value: true });
})(this["vue-encyclopedia"] = this["vue-encyclopedia"] || {}, vue);