Skip to content

Commit b3b75d1

Browse files
committed
small changes
1 parent eee07f6 commit b3b75d1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

01-HelloWorld/03-ComponentSocks.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const app = Vue.createApp({
66
};
77
},
88
methods: {
9-
updateCart(product) {
9+
updateCart(product, variant) {
1010
console.log('Adding to cart:', product);
1111
this.cart.push(product);
1212
}
@@ -23,8 +23,8 @@ app.component('product', {
2323
premium: {type: Boolean, required: true, default: false},
2424
// Types: String, Number, Array, Object, Function, Promise, any ctor
2525
// Null and undefined always pass validation
26-
// oneOf: [String, Number],
27-
// special: {
26+
// nameOfProp: [String, Number],
27+
// nameOfAnotherProp: {
2828
// default() { return 'calculatedValue'; },
2929
// validator(value) { return true; }
3030
// }

01-HelloWorld/04-ReviewableSocks.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ const app = Vue.createApp({
1515

1616

1717

18+
// Options API
1819
app.component('product-review', {
1920
template: `
2021
<form class="review-form" @submit.prevent="onSubmit">
2122
<!-- Modifiers: -->
2223
<!-- .prevent => .preventDefault() -->
2324
<!-- .stop => .stopPropagation() -->
2425
<!-- .once => Unregister after first trigger -->
25-
<!-- .self => Trigger only when the element is the .target -->
26+
<!-- .self => Trigger only when the element is the $event.target -->
2627
2728
<h3>Add Review</h3>
2829
<label>Name</label>

cli-socks/src/views/SocksListing.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<script lang="ts">
2+
// Composition API
23
import Product from "../components/Product.vue";
34
import { ProductModel } from "../models/ProductModels";
45
import { ref, reactive, computed } from 'vue';

0 commit comments

Comments
 (0)