Skip to content

Instantly share code, notes, and snippets.

@zaki-yama
Last active March 14, 2024 17:50
Show Gist options
  • Save zaki-yama/1b034a6b26bb3a4aa1bb4600b5a60a81 to your computer and use it in GitHub Desktop.
Save zaki-yama/1b034a6b26bb3a4aa1bb4600b5a60a81 to your computer and use it in GitHub Desktop.
kintone-vue-customize.js
/*
* kintone x Vuejs
* Copyright (c) 2016 Cybozu
*
* Licensed under the MIT License
* https://opensource.org/license/mit/
*/
(function ($) {
"use strict";
const { createApp } = Vue;
kintone.events.on("app.record.index.show", (event) => {
if (event.viewId !== 5118521) return event; // 作成したカスタマイズビューのIDを指定
const customers = [
{ companyName: "株式会社A", tel: "0123-45-6789" },
{ companyName: "株式会社B", tel: "1123-45-6789" },
{ companyName: "株式会社C", tel: "2123-45-6789" },
{ companyName: "株式会社D", tel: "3123-45-6789" },
];
// 作成されたVueインスタンスをカスタマイズビューで用意した #app にマウント
const app = createApp().mount("#app");
console.log(app);
// データをセット
app.customers = customers;
return event;
});
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment