不使用构建系统时如何更改全局Element UI配置?

时间:2019-04-01 08:54:34

标签: element-ui

在多页应用程序中,我想使用Element UI组件框架而不使用构建系统,而是静态地服务所有依赖项。该示例使用CDN。我想更改全局Element UI配置,请参见此处:https://codepen.io/bitflipp/pen/XQWwMy

<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
</head>
<body>
  <div id="app">
    <el-button>I want to be "mini" through global configuration</el-button>
    <el-button size="mini">I am "mini" because of an attribute</el-button>
  </div>
</body>
  <script src="https://unpkg.com/vue/dist/vue.js"></script>
  <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  <script>
    /* How can this be achieved?
    import Vue from "vue";
    import Element from "element-ui";
    Vue.use(Element, { size: "mini" });
    */
    new Vue().$mount("#app");
  </script>
</html>

0 个答案:

没有答案