0.0.16 • Published 6 years ago

shogi_player v0.0.16

Weekly downloads
104
License
MIT
Repository
-
Last release
6 years ago

Build Status Maintainability Test Coverage Dependency Status npm version GitHub version

将棋棋譜プレイヤー

Demo

Rails で使用する例

% yarn add shogi_player

app/javascript/packs/shogi_player.js

import Vue from 'vue/dist/vue.esm'
import ShogiPlayer from 'shogi_player/src/components/ShogiPlayer.vue'

document.addEventListener('DOMContentLoaded', () => {
  const app = new Vue({
    el: '#shogi_player_app',
    components: { "shogi_player": ShogiPlayer },
  })
})

app/views/xxx/show.html.erb

<%= javascript_pack_tag("shogi_player") %>
<%= stylesheet_pack_tag("shogi_player") %>

<div id="shogi_player_app">
  <shogi_player :kifu_body="'position startpos moves 7g7f 8c8d'" :turn_start="-1"></shogi_player>
</div>

引数

props意味例・補足
kifu_body棋譜例: position startpos必須
turn_startN手目0:最初 -1:最後オプション
keyboard_operation_flagキーボード操作を充実させるどこにもフォーカスしていないときでも左右が反応するオプション
location_hash_embed_turnURLのハッシュに手番を埋めるブラウザがその個所を探そうとしてやや重くなるので注意オプション

Build Setup

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# build for production with minification
npm run build

# build for production and view the bundle analyzer report
npm run build --report

# run unit tests
npm run unit

# run e2e tests
npm run e2e

# run all tests
npm test

For a detailed explanation on how things work, check out the guide and docs for vue-loader.