Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c81ddc0

Browse files
Bump version (#4)
* fix: bump version and add logo * fix: clean example
1 parent 92423cc commit c81ddc0

File tree

5 files changed

+56
-56
lines changed

5 files changed

+56
-56
lines changed

‎generator/index.js

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,29 @@
1-
let ui5 = "\nVue.config.ignoredElements = [/^ui5-/];";
1+
let ui5 = '\nVue.config.ignoredElements = [/^ui5-/];'
22

33
module.exports = (api, options, rootOptions) => {
4-
api.extendPackage({
5-
dependencies: {
6-
"@ui5/webcomponents": "^0.9.0"
7-
}
8-
});
9-
if (options.addExample) {
10-
api.render("./template", {
11-
...options
12-
});
4+
api.extendPackage({
5+
dependencies: {
6+
'@ui5/webcomponents': '^0.13.0'
137
}
14-
api.onCreateComplete(() => {
15-
// inject to main.js
16-
const fs = require("fs");
17-
const ext = api.hasPlugin("typescript")
18-
? "ts"
19-
: "js";
20-
const mainPath = api.resolve(`./src/main.${ext}`);
21-
let contentMain = fs.readFileSync(mainPath, {encoding: "utf-8"});
22-
const lines = contentMain
23-
.split(/\r?\n/g)
24-
.reverse();
8+
})
9+
if (options.addExample) {
10+
api.render('./template', {
11+
...options
12+
})
13+
}
14+
api.onCreateComplete(() => {
15+
// inject to main.js
16+
const fs = require('fs')
17+
const ext = api.hasPlugin('typescript') ? 'ts' : 'js'
18+
const mainPath = api.resolve(`./src/main.${ext}`)
19+
let contentMain = fs.readFileSync(mainPath, { encoding: 'utf-8' })
20+
const lines = contentMain.split(/\r?\n/g).reverse()
2521

26-
const lastImportIndex = lines.findIndex(line => line.match(/^import/));
27-
lines[lastImportIndex] += ui5;
22+
const lastImportIndex = lines.findIndex(line => line.match(/^import/))
23+
lines[lastImportIndex] += ui5
2824

29-
contentMain = lines
30-
.reverse()
31-
.join("\n");
32-
fs.writeFileSync(mainPath, contentMain, {encoding: "utf-8"});
33-
api.exitLog("Successfully installed UI5 Web Components", "done");
34-
});
35-
};
25+
contentMain = lines.reverse().join('\n')
26+
fs.writeFileSync(mainPath, contentMain, { encoding: 'utf-8' })
27+
api.exitLog('Successfully installed UI5 Web Components', 'done')
28+
})
29+
}

‎generator/template/src/UI5Example.vue

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<template>
2+
<div>
3+
<ui5-shellbar primary-title="UI5 Web Components CLI Plugin Example"></ui5-shellbar>
4+
<ui5-tabcontainer show-overflow>
5+
<ui5-tab v-for="tab in tabs" :key="tab" :text="tab">
6+
<ui5-button @click="onClick(tab)">{{tab}}</ui5-button>
7+
<ui5-icon v-show="tab==='Home'" src="sap-icon://add-employee"></ui5-icon>
8+
</ui5-tab>
9+
</ui5-tabcontainer>
10+
</div>
11+
</template>
12+
<script>
13+
import "@ui5/webcomponents/dist/Button";
14+
import "@ui5/webcomponents/dist/ShellBar";
15+
import "@ui5/webcomponents/dist/Icon";
16+
import "@ui5/webcomponents/dist/TabContainer";
17+
import "@ui5/webcomponents/dist/Tab";
18+
export default {
19+
data: function() {
20+
return {
21+
tabs: ["Home", "About", "News", "Contacts"]
22+
};
23+
},
24+
methods: {
25+
onClick(text) {
26+
console.log(text);
27+
}
28+
}
29+
};
30+
</script>

‎logo.png

28.8 KB
Loading[フレーム]

‎package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-cli-plugin-ui5-webcomponents",
3-
"version": "0.0.2",
4-
"description": "",
3+
"version": "0.0.3",
4+
"description": "Vue-cli 3 plugin for adding UI5 Web Componentsx",
55
"main": "index.js",
66
"repository": {
77
"type": "git",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /