Fix svg sprite
This commit is contained in:
parent
1d8b5b4670
commit
9e1fe63c33
|
@ -24,7 +24,7 @@ steps:
|
||||||
- name: node
|
- name: node
|
||||||
image: node:17.9.0-slim
|
image: node:17.9.0-slim
|
||||||
commands:
|
commands:
|
||||||
- npm ci && npm run prod && npm run img && rm -R node_modules
|
- npm ci && npm run img && npm run prod && rm -R node_modules
|
||||||
|
|
||||||
- name: phpunit_tests
|
- name: phpunit_tests
|
||||||
image: php:8.1.6
|
image: php:8.1.6
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
/node_modules
|
/node_modules
|
||||||
/public/build
|
/public/build
|
||||||
|
/public/sprite.svg
|
||||||
|
/public/hot
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
/vendor
|
/vendor
|
||||||
.env
|
.env
|
||||||
|
|
10
package.json
10
package.json
|
@ -2,12 +2,12 @@
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run development",
|
"dev": "npm run development",
|
||||||
"development": "npx mix build",
|
"development": "npx vite",
|
||||||
"watch": "npx mix watch",
|
"watch": "npx vite",
|
||||||
"hot": "npx mix watch --hot",
|
"hot": "npx vite",
|
||||||
"prod": "npx mix build --production",
|
"prod": "npx vite build",
|
||||||
"production": "npm run prod",
|
"production": "npm run prod",
|
||||||
"img": "rm -R public/img && cd resources/img/svg && npx svg-sprite -s --symbol-dest=sprite *.svg && mv sprite/svg/sprite.css.svg ../sprite.svg && rm -R sprite && cd ../../../ && cp -R resources/img public/img",
|
"img": "cd resources/img/svg && npx svg-sprite -s --symbol-dest=sprite *.svg && mv sprite/svg/sprite.css.svg ../../../public/sprite.svg && rm -R sprite",
|
||||||
"lint": "eslint \"resources/js/**/*.{js,vue}\"",
|
"lint": "eslint \"resources/js/**/*.{js,vue}\"",
|
||||||
"fix": "eslint \"resources/js/**/*.{js,vue}\" --fix"
|
"fix": "eslint \"resources/js/**/*.{js,vue}\" --fix"
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,17 +1,25 @@
|
||||||
export default {
|
export default {
|
||||||
props: {
|
props: {
|
||||||
src: { required: true, type: String }
|
src: {required: true, type: String},
|
||||||
},
|
},
|
||||||
render: function (createElement) {
|
render: function (createElement) {
|
||||||
var attr = this.$attrs.class ? this.$attrs.class : '';
|
var attr = this.$attrs.class ? this.$attrs.class : '';
|
||||||
return createElement('svg', {
|
return createElement(
|
||||||
class: attr + ' fill-current'
|
'svg',
|
||||||
}, [
|
{
|
||||||
createElement('use', {
|
class: attr + ' fill-current',
|
||||||
'attrs': {
|
},
|
||||||
'xlink:href': `/img/sprite.svg#${this.$props.src}`
|
[
|
||||||
}
|
createElement(
|
||||||
}, '')
|
'use',
|
||||||
] );
|
{
|
||||||
}
|
attrs: {
|
||||||
|
'xlink:href': `/sprite.svg#${this.$props.src}`,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
''
|
||||||
|
),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue