Skip to content

Commit 319d078

Browse files
committed
Remove css modules
1 parent bd31d06 commit 319d078

6 files changed

Lines changed: 24 additions & 33 deletions

File tree

samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/components/form.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import {
55
} from '../../../../common/components/form';
66
import {IngredientListComponent} from './ingredientList';
77

8-
const classNames: any = require('./formStyles');
9-
10-
interface FormComponentProperties extends Vue {
8+
interface FormComponentOptions extends Vue {
119
recipe: RecipeEntity;
1210
recipeError: RecipeError;
1311
updateRecipe: (name) => void;
@@ -27,11 +25,9 @@ export const FormComponent = Vue.extend({
2725
'removeIngredient',
2826
'save',
2927
],
30-
data: function() {
31-
return {
32-
ingredient: ''
33-
}
34-
},
28+
data: () => ({
29+
ingredient: ''
30+
}),
3531
methods: {
3632
addIngredientHandler: function(e) {
3733
e.preventDefault();
@@ -94,4 +90,4 @@ export const FormComponent = Vue.extend({
9490
</form>
9591
);
9692
},
97-
} as ComponentOptions<FormComponentProperties>);
93+
} as ComponentOptions<FormComponentOptions>);

samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/components/formStyles.css

Lines changed: 0 additions & 3 deletions
This file was deleted.

samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/components/ingredientList.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
import Vue from 'vue';
1+
import Vue, {ComponentOptions} from 'vue';
22
import {IngredientRowComponent} from './ingredientRow';
33

4+
interface Props extends Vue {
5+
ingredients: string[];
6+
removeIngredient: (ingredient) => void;
7+
}
8+
49
export const IngredientListComponent = Vue.extend({
510
props: [
611
'ingredients',
@@ -23,4 +28,4 @@ export const IngredientListComponent = Vue.extend({
2328
</div>
2429
);
2530
},
26-
});
31+
} as ComponentOptions<Props>);

samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/components/ingredientRow.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import Vue from 'vue';
1+
import Vue, {ComponentOptions} from 'vue';
2+
3+
interface Props extends Vue {
4+
ingredient: string;
5+
removeIngredient: (ingredient) => void;
6+
}
27

38
export const IngredientRowComponent = Vue.extend({
49
props: [
@@ -20,4 +25,4 @@ export const IngredientRowComponent = Vue.extend({
2025
</div>
2126
);
2227
},
23-
});
28+
} as ComponentOptions<Props>);

samples/vuejs/typescript/00 Custom Validator/src/pages/recipe/edit/pageContainer.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export const EditRecipeContainer = Vue.extend({
8686
.then((result) => {
8787
result.fieldErrors
8888
.map((error) => this.updateRecipeError(error.key, error));
89+
90+
if(result.succeeded) {
91+
console.log('Save recipe');
92+
}
8993
});
9094
},
9195
}

samples/vuejs/typescript/00 Custom Validator/webpack.config.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var basePath = __dirname;
88
module.exports = {
99
context: path.join(basePath, 'src'),
1010
resolve: {
11-
extensions: ['.js', '.ts', '.tsx', '.css'],
11+
extensions: ['.js', '.ts', '.tsx'],
1212
},
1313
entry: {
1414
app: './main.tsx',
@@ -39,22 +39,6 @@ module.exports = {
3939
},
4040
{
4141
test: /\.css$/,
42-
exclude: /node_modules/,
43-
loader: ExtractTextPlugin.extract({
44-
fallback: 'style-loader',
45-
use: {
46-
loader: 'css-loader',
47-
options: {
48-
module: true,
49-
localIdentName: '[name]__[local]___[hash:base64:5]',
50-
camelCase: true,
51-
}
52-
},
53-
}),
54-
},
55-
{
56-
test: /\.css$/,
57-
include: /node_modules/,
5842
loader: ExtractTextPlugin.extract({
5943
fallback: 'style-loader',
6044
use: {

0 commit comments

Comments
 (0)