1.2.12 • Published 3 years ago

whim-client-vue v1.2.12

Weekly downloads
17
License
MIT
Repository
-
Last release
3 years ago

whim-client-vue

npm version github workflow MIT License

概要

wh.im 上でゲームの開発が簡単にできます。Vue.js用です。

whim-clientのインストール

以下のコマンドでVue.jsのプロジェクトに追加します。

$ npm install --save whim-client-vue
# or
$ yarn add whim-client-vue

main.jsでのwhim-clientの読み込み

main.jsを以下のような構成にします。

import Vue from "vue";
import App from "./App.vue";
import whimClientVue from "whim-client-vue";
import "whim-client-vue/dist/whim-client-vue.css";

Vue.config.productionTip = false;
Vue.use(whimClientVue);

new Vue({
  render: h => h(App)
}).$mount("#app");

1. whim-client-vueの読み込み

import whimClientVue from "whim-client-vue";
import "whim-client-vue/dist/whim-client-vue.css";

2. vueにライブラリの登録

Vue.use(whimClientVue);

whim-clientの使用例

this.$whimでVue.js上からwhimのデータの読み出し/書き込みができるようになります。

// user一覧の取り出し
this.$whim.users;

// stateの取り出し
this.$whim.state;

// stateの差分更新
this.$whim.assignState({point: 2})

// stateの全更新
this.$whim.resetState({phase: "start"})

より詳細にはAPI一覧をご覧ください。

サンプルアプリ

サンプルアプリをいくつかご用意しました。参考にしてください。

開発の仕方

  1. リポジトリをクローン
  2. 本リポジトリでyarn link
  3. appsでyarn link whim-client-vue
  4. 初回&ソースコード変更のたびにyarn build
  • これを自動watchする方法はありそう。
1.2.12

3 years ago

1.2.11

4 years ago

1.2.10

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.3.1

4 years ago