Skip to content

Commit 790b0b7

Browse files
committed
refactor example
1 parent 0967855 commit 790b0b7

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

example/plugins/custom-code.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
:style="{
44
border: '3px solid tomato',
55
}"
6-
v-if="prism && supported"
76
:class="['notion-code', langClass]"
8-
><PrismComponent :language="lang">{{ properties.title[0][0] }}</PrismComponent></pre>
9-
<pre
10-
v-else
11-
:class="['notion-code', langClass]"
12-
><code :class="langClass">{{ properties.title[0][0] }}</code></pre>
7+
>
8+
<PrismComponent v-if="prism && supported" :language="lang">{{ properties.title[0][0] }}</PrismComponent>
9+
<code v-else :class="langClass">{{ properties.title[0][0] }}</code>
10+
</pre>
1311
</template>
1412

1513
<script>
1614
import Prism from "prismjs";
1715
import PrismComponent from "vue-prism-component";
16+
1817
import { Blockable, blockComputed, blockProps } from "vue-notion";
1918
2019
export default {

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
],
1616
"scripts": {
1717
"serve": "vue-cli-service serve dev/serve.js",
18-
"example": "nuxt example",
19-
"example:pack": "npm pack && cd example && npm install && npm install ../*.tgz && npm run build && npm run generate",
18+
"example": "npm run example:pack && cd example && npm run build && npm start",
19+
"example:pack": "npm run build && npm pack && cd example && npm install && npm install ../*.tgz",
20+
"example:generate": "npm run example:pack && cd example && npm run build && npm run generate",
2021
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",
2122
"build:ssr": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format cjs",
2223
"build:es": "cross-env NODE_ENV=production rollup --config build/rollup.config.js --format es",

src/entry.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ if ("false" === process.env.ES_BUILD) {
2929
GlobalVue.use(plugin);
3030
}
3131
}
32+
// Default export is library as a whole, registered via Vue.use()
33+
export default plugin;
3234

3335
// To allow individual component use, export components
3436
// each can be registered via Vue.component()
@@ -39,7 +41,4 @@ export * from "@/lib/api";
3941
export * from "@/lib/blockable";
4042
export * from "@/lib/utils";
4143

42-
// Default export is library as a whole, registered via Vue.use()
43-
export default plugin;
44-
4544
// todo: remove .esm from default packaging for cleaner imports

0 commit comments

Comments
 (0)