Files
vxe-table/examples/views/table/start/Install.vue
xuliangzhan 4f91ad36c3 update
2019-06-02 15:12:21 +08:00

44 lines
1.3 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<h3>npm 安装</h3>
<p>推荐使用 npm 的方式安装它能更好地和 <a class="link" href="https://webpack.js.org/">webpack</a> 打包工具配合使用</p>
<pre>
<code class="javascript">
npm install vxe-table
</code>
</pre>
<pre>
<code class="javascript">
import Vue from 'vue'
import VXETable from 'vxe-table'
import 'vxe-table/lib/index.css'
Vue.use(VXETable)
</code>
</pre>
<h3>CDN</h3>
<p>可以通过 <a class="link" href="https://unpkg.com/vxe-table/">unpkg</a> <a class="link" href="https://cdn.jsdelivr.net/npm/vxe-table/">cdnjs</a> 获取到最新版本的资源并在页面上引入即可</p>
<pre>
<code class="xml">
&lt;!-- 引入样式 --&gt;
&lt;link rel="stylesheet" href="https://unpkg.com/vxe-table/lib/index.css"&gt;
&lt;!-- 引入脚本 --&gt;
&lt;script src="https://unpkg.com/xe-utils"&gt;&lt;/script&gt;
&lt;script src="https://unpkg.com/vxe-table"&gt;&lt;/script&gt;
</code>
</pre>
</div>
</template>
<script>
import hljs from 'highlight.js'
export default {
mounted () {
Array.from(this.$el.querySelectorAll('pre code')).forEach((block) => {
hljs.highlightBlock(block)
})
}
}
</script>