This file contains 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
<template> | |
<h1>Hello World with webpack-dev-server</h1> | |
</template> | |
<script> | |
export default { | |
data () { | |
return {} | |
} | |
} |
This file contains 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
npm install vue-loader css-loader vue-template-compiler -=save-dev | |
# 或者 | |
yarn add vue-loader css-loader vue-template-compiler --dev |
This file contains 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
# 在终端中输入以监听 localhost:1333 的结果 | |
while :; do clear; nc -l localhost 1333; sleep 2; done |
This file contains 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 sayHelloToWithReply = (name) => { | |
alert(`Hello, ${name}! (sayHelloToWithReply() invoked from javascript)`); | |
return `Hello ${name}! (sayHelloToWithReply() invoked from javascript)` | |
} |
This file contains 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 sayHelloTo = (name) => { | |
alert(`Hello, ${name}! (sayHelloTo(name) invoked from javascript)`); | |
} |
This file contains 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 sayHello = () => { | |
alert('Hello (sayHello() invoked from javascript)'); | |
} |
This file contains 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
extension NativeInvokeJavaScriptBrowserViewController: WKNavigationDelegate { | |
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { | |
switch requestJavaScriptMethod! | |
{ | |
case "SayHelloTo": | |
wkWebView.evaluateJavaScript("sayHelloTo('Lien')") | |
case "SayHelloToWithReply": | |
wkWebView.evaluateJavaScript("sayHelloToWithReply('Lien')") { (any,error) -> Void in | |
print("\(any as! String)") |
This file contains 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
progressView = UIProgressView( | |
frame: CGRect( | |
origin: CGPoint(x: 0, y: 64), | |
size: CGSize(width: self.view.frame.width, height: 1) | |
) | |
) | |
let width = self.view.bounds.size.width | |
let height = self.view.bounds.size.height |
This file contains 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
var gulp = require('gulp'); | |
var path = require('path'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('minify-js', function() { | |
// 首先去除我们之后想要合并的 base*.js 和 package 文件的监听 | |
// 然后对剩下文件进行 watch | |
return gulp.watch([ | |
'**/*.js', |
This file contains 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 loop = () => { | |
ctx.clearRect(0, 0, $canvas.width, $canvas.height); | |
let x = 125 + Math.cos(angle) * 100 | |
let y = 125 + Math.sin(angle) * 100 | |
ctx.fillStyle = "hotpink"; | |
ctx.beginPath(); | |
ctx.arc(x, y, 10, 0, getRads(360)); | |
ctx.closePath(); |