add eslint
This commit is contained in:
13
.eslintrc.json
Normal file
13
.eslintrc.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"extends": "google",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 7,
|
||||||
|
"sourceType": "module"
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"require-jsdoc": "off",
|
||||||
|
"arrow-parens": "off",
|
||||||
|
"object-curly-spacing": "off"
|
||||||
|
},
|
||||||
|
"plugins": ["html"]
|
||||||
|
}
|
||||||
@@ -2,6 +2,9 @@
|
|||||||
"name": "rrweb-player",
|
"name": "rrweb-player",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"eslint": "^5.7.0",
|
||||||
|
"eslint-config-google": "^0.11.0",
|
||||||
|
"eslint-plugin-html": "^4.0.6",
|
||||||
"npm-run-all": "^4.1.3",
|
"npm-run-all": "^4.1.3",
|
||||||
"rollup": "^0.66.2",
|
"rollup": "^0.66.2",
|
||||||
"rollup-plugin-commonjs": "^9.1.8",
|
"rollup-plugin-commonjs": "^9.1.8",
|
||||||
@@ -18,4 +21,4 @@
|
|||||||
"start": "sirv public",
|
"start": "sirv public",
|
||||||
"start:dev": "sirv public --dev"
|
"start:dev": "sirv public --dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
15
src/App.html
15
src/App.html
@@ -1,5 +1,5 @@
|
|||||||
<h1>
|
<h1>
|
||||||
rrweb player playground
|
rrweb player playground
|
||||||
</h1>
|
</h1>
|
||||||
<Player />
|
<Player />
|
||||||
|
|
||||||
@@ -7,11 +7,10 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Player from './Player.html';
|
import Player from './Player.html';
|
||||||
|
export default {
|
||||||
export default {
|
components: {
|
||||||
components: {
|
Player,
|
||||||
Player
|
},
|
||||||
}
|
};
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
<div class="rr-player">
|
<div class="rr-player" { style }>
|
||||||
rrplayer
|
rrplayer
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -9,9 +9,23 @@
|
|||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { inlineCss } from '../util.js';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {}
|
return {
|
||||||
}
|
width: 1024,
|
||||||
}
|
height: 576,
|
||||||
</script>
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
style({ width, height }) {
|
||||||
|
return inlineCss({
|
||||||
|
width: `${width}px`,
|
||||||
|
height: `${height}px`,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
||||||
10
src/main.js
10
src/main.js
@@ -1,10 +1,10 @@
|
|||||||
import App from './App.html';
|
import App from './App.html';
|
||||||
|
|
||||||
const app = new App({
|
const app = new App({
|
||||||
target: document.body,
|
target: document.body,
|
||||||
data: {
|
data: {
|
||||||
name: 'world'
|
name: 'world',
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default app;
|
export default app;
|
||||||
|
|||||||
7
src/util.js
Normal file
7
src/util.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
export function inlineCss(cssObj) {
|
||||||
|
let style = '';
|
||||||
|
Object.keys(cssObj).forEach(key => {
|
||||||
|
style += `${key}: ${cssObj[key]};`;
|
||||||
|
});
|
||||||
|
return style;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user