Skip to content
This repository was archived by the owner on Jul 10, 2019. It is now read-only.

Commit fff9df1

Browse files
authored
Merge pull request #1 from hisasann/feature/add-extend-css-class
Feature/add extend css class
2 parents 430a8c4 + f574987 commit fff9df1

File tree

6 files changed

+89
-4
lines changed

6 files changed

+89
-4
lines changed

nuxt.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ module.exports = {
6161
// Doc: https://axios.nuxtjs.org/usage
6262
'@nuxtjs/axios',
6363
'@nuxtjs/pwa',
64+
// https://github.com/nuxt-community/style-resources-module/
65+
'@nuxtjs/style-resources',
6466
// https://github.com/potato4d/nuxt-client-init-module
6567
// https://qiita.com/potato4d/items/cc5d8ea24949e86f8a5b
6668
'nuxt-client-init-module',
@@ -132,5 +134,8 @@ module.exports = {
132134
component: resolve(__dirname, 'src/include/include.vue')
133135
})
134136
}
137+
},
138+
styleResources: {
139+
scss: ['@/assets/styles/components/**/*.scss']
135140
}
136141
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
},
6464
"devDependencies": {
6565
"@nuxtjs/eslint-config": "^0.0.1",
66+
"@nuxtjs/style-resources": "^0.1.2",
6667
"@storybook/vue": "^4.1.13",
6768
"@types/babel-core": "6.25.6",
6869
"@types/eslint": "^4.16.6",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.color {
2+
color: aqua;
3+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<template lang="pug">
2+
div
3+
h1.title
4+
| include
5+
span.color {{ message }}
6+
</template>
7+
8+
<script lang="ts">
9+
import { Component, Vue } from 'nuxt-property-decorator'
10+
11+
@Component
12+
export default class Include extends Vue {
13+
message: string = 'hello include!'
14+
15+
beforeCreate() {
16+
console.log('beforeCreate')
17+
}
18+
created() {
19+
console.log('created')
20+
}
21+
22+
public head() {
23+
return {
24+
title: 'hello include'
25+
}
26+
}
27+
}
28+
</script>
29+
30+
<style lang="scss" scoped>
31+
.color {
32+
@extend .color;
33+
}
34+
</style>

src/pages/example/index.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
p
4545
nuxt-link(to='/example/type-safe-vuex')
4646
| type-safe-vuex
47+
p
48+
nuxt-link(to='/example/extend-css-class')
49+
| extend-css-class
4750
</template>
4851

4952
<script lang="ts">

yarn.lock

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,6 +1199,15 @@
11991199
"@nuxtjs/pwa-utils" "3.0.0-beta.8"
12001200
"@nuxtjs/workbox" "3.0.0-beta.8"
12011201

1202+
"@nuxtjs/style-resources@^0.1.2":
1203+
version "0.1.2"
1204+
resolved "https://registry.yarnpkg.com/@nuxtjs/style-resources/-/style-resources-0.1.2.tgz#6d90637611d3a445158224c34e42ec5769e13aaa"
1205+
integrity sha512-hF4kxO3ETHnJlscBOHM/UKasMwrdlODb+y6mv9mnsyn1Ujvp7kMqOmUmhKcemDexXEzpc5eniIOOq+Nul8JAKA==
1206+
dependencies:
1207+
consola "^2.4.0"
1208+
glob-all "^3.1.0"
1209+
sass-resources-loader "^2.0.0"
1210+
12021211
"@nuxtjs/workbox@3.0.0-beta.8":
12031212
version "3.0.0-beta.8"
12041213
resolved "https://registry.yarnpkg.com/@nuxtjs/workbox/-/workbox-3.0.0-beta.8.tgz#695dea70bcf46c805826e6bbe7b80d538222799a"
@@ -2289,7 +2298,7 @@ async-limiter@~1.0.0:
22892298
version "1.0.0"
22902299
resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.0.tgz#78faed8c3d074ab81f22b4e985d79e8738f720f8"
22912300

2292-
async@^2.3.0, async@^2.5.0, async@^2.6.1:
2301+
async@^2.1.4, async@^2.3.0, async@^2.5.0, async@^2.6.1:
22932302
version "2.6.2"
22942303
resolved "https://registry.yarnpkg.com/async/-/async-2.6.2.tgz#18330ea7e6e313887f5d2f2a904bac6fe4dd5381"
22952304
dependencies:
@@ -3406,7 +3415,7 @@ consola@^1.4.4:
34063415
lodash "^4.17.5"
34073416
std-env "^1.1.0"
34083417

3409-
consola@^2.0.0-1, consola@^2.3.0, consola@^2.3.2, consola@^2.4.1:
3418+
consola@^2.0.0-1, consola@^2.3.0, consola@^2.3.2, consola@^2.4.0, consola@^2.4.1:
34103419
version "2.5.6"
34113420
resolved "https://registry.yarnpkg.com/consola/-/consola-2.5.6.tgz#5ce14dbaf6f5b589c8a258ef80ed97b752fa57d5"
34123421

@@ -5096,6 +5105,14 @@ getpass@^0.1.1:
50965105
dependencies:
50975106
assert-plus "^1.0.0"
50985107

5108+
glob-all@^3.1.0:
5109+
version "3.1.0"
5110+
resolved "https://registry.yarnpkg.com/glob-all/-/glob-all-3.1.0.tgz#8913ddfb5ee1ac7812656241b03d5217c64b02ab"
5111+
integrity sha1-iRPd+17hrHgSZWJBsD1SF8ZLAqs=
5112+
dependencies:
5113+
glob "^7.0.5"
5114+
yargs "~1.2.6"
5115+
50995116
glob-parent@^3.1.0:
51005117
version "3.1.0"
51015118
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
@@ -5107,7 +5124,7 @@ glob-to-regexp@^0.3.0:
51075124
version "0.3.0"
51085125
resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab"
51095126

5110-
glob@^7.0.0, glob@^7.0.3, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1:
5127+
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@^7.1.1, glob@^7.1.2, glob@^7.1.3, glob@~7.1.1:
51115128
version "7.1.3"
51125129
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1"
51135130
dependencies:
@@ -6673,7 +6690,7 @@ loader-utils@^0.2.16:
66736690
json5 "^0.5.0"
66746691
object-assign "^4.0.1"
66756692

6676-
loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.1.0, loader-utils@^1.2.1:
6693+
loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.0.4, loader-utils@^1.1.0, loader-utils@^1.2.1:
66776694
version "1.2.3"
66786695
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.2.3.tgz#1ff5dc6911c9f0a062531a4c04b609406108c2c7"
66796696
dependencies:
@@ -6995,6 +7012,11 @@ minimist@0.0.8:
69957012
version "0.0.8"
69967013
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
69977014

7015+
minimist@^0.1.0:
7016+
version "0.1.0"
7017+
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.1.0.tgz#99df657a52574c21c9057497df742790b2b4c0de"
7018+
integrity sha1-md9lelJXTCHJBXSX33QnkLK0wN4=
7019+
69987020
minimist@^1.1.1, minimist@^1.1.3, minimist@^1.2.0:
69997021
version "1.2.0"
70007022
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"
@@ -9422,6 +9444,16 @@ sass-loader@^7.1.0:
94229444
pify "^3.0.0"
94239445
semver "^5.5.0"
94249446

9447+
sass-resources-loader@^2.0.0:
9448+
version "2.0.0"
9449+
resolved "https://registry.yarnpkg.com/sass-resources-loader/-/sass-resources-loader-2.0.0.tgz#88569c542fbf1f18f33a6578b77cc5b36c56911d"
9450+
integrity sha512-I+5FfV+Hb29U5Nt8DbslWOBgRmTv1M/EwOn4/4rc6Aqy9yjygoa8UTnyCFXfTZV8FoQyIBZbEyKSBryhByqQbA==
9451+
dependencies:
9452+
async "^2.1.4"
9453+
chalk "^1.1.3"
9454+
glob "^7.1.1"
9455+
loader-utils "^1.0.4"
9456+
94259457
sax@>=0.6.0, sax@^1.2.4, sax@~1.2.4:
94269458
version "1.2.4"
94279459
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
@@ -11203,6 +11235,13 @@ yargs@^7.0.0:
1120311235
y18n "^3.2.1"
1120411236
yargs-parser "^5.0.0"
1120511237

11238+
yargs@~1.2.6:
11239+
version "1.2.6"
11240+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-1.2.6.tgz#9c7b4a82fd5d595b2bf17ab6dcc43135432fe34b"
11241+
integrity sha1-nHtKgv1dWVsr8Xq23MQxNUMv40s=
11242+
dependencies:
11243+
minimist "^0.1.0"
11244+
1120611245
yargs@~3.10.0:
1120711246
version "3.10.0"
1120811247
resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"

0 commit comments

Comments
 (0)