<div id="side-cart-js">
<template>
<transition name="fade">
<div @click="submitCart" class="btn-float-cart" v-show="isVisible">
<img src="{{ 'cart-icon.svg' | asset_url }}" />
</div>
</transition>
</template>
</div>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react' | |
import Counter from './Counter' | |
interface Props { | |
name: string | |
} | |
const HelloWorld: React.FC<Props> = ({ name }) => { | |
const [state] = useState < { fullname: string | null }>({fullname: ""}) | |
return <div>hello {name}</div> | |
} |
.
- Any one character
*
- Match any number of previous (including 0)
+
- Match any number of previous
$
- End of the line
^
- Begining of the line
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Book { | |
constructor(title, author, year) { | |
this.title = title | |
this.author = author | |
this.year = year | |
} | |
getAge = () => { | |
console.log(this) | |
const years = new Date().getFullYear() - this.year | |
return `${this.title} is published for ${years} years` |
<template>
<transition name="fade">
<div @click="submitCart" class="btn-float-cart" v-show="isVisible">
<img src="{{ 'cart-icon.svg' | asset_url }}" />
</div>
</transition>
</template>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix') | |
mix.babelConfig({ | |
plugins: ['@babel/plugin-proposal-class-properties'] | |
}) | |
mix | |
.react('resources/js/app.js', 'public/js') | |
.sass('resources/sass/app.scss', 'public/css') | |
.disableSuccessNotifications() | |
.version() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// reference:https://shopify.dev/tutorials/authenticate-with-oauth | |
// This will redirect to app update page | |
// This is laravel version | |
$shop = YOUR_SHOP_DOMAIN; | |
$scopes = config('shopify-app.api_scopes'); | |
$api_key = config('shopify-app.api_key'); | |
// 'https://homestead.test/authenticate' | |
$redirect = AUTHENTICATE_URL_IN_PARNTER_PAGE; | |
$url = 'https://'. $shop .'.myshopify.com/admin/oauth/authorize?client_id='.$api_key.'&scope='.$scopes.'&redirect_uri='.$redirect; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState } from 'react' | |
const login = ({ username, password }) => { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
if (Object.is(username, 'bili') && Object.is(password, 'bili')) { | |
console.log(username, password) | |
resolve('success') | |
} else { | |
console.log(username, password) |