{"id":1298,"date":"2020-04-20T08:33:24","date_gmt":"2020-04-19T23:33:24","guid":{"rendered":"https:\/\/ts-engine.net\/?p=1298"},"modified":"2020-04-20T08:33:24","modified_gmt":"2020-04-19T23:33:24","slug":"jinja2%e5%a5%bd%e3%81%8d%e3%81%a0%e3%81%91%e3%81%a9%e3%80%81nuxt-js%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"http:\/\/ts-engine.net\/?p=1298","title":{"rendered":"\u666e\u6bb5\u306fJinja2\u3064\u304b\u3046\u3053\u3068\u304c\u591a\u3044\u304c\u3001Nuxt.js\u3092\u4f7f\u3063\u3066\u307f\u305f"},"content":{"rendered":"<p>\n\u3082\u3068\u3082\u3068Pyhton\u306ejinja2\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u51e6\u7406\u3092\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u3001<br \/>\n\u305f\u307e\u306b\u975e\u540c\u671f\u306e\u51e6\u7406\u3092\u884c\u3046\u3068\u304d\u306b\u306fjQuery\u3092\u4f7f\u3063\u3066\u3044\u305f\u304c\u3002\u3067\u3082\u57fa\u672c\u306f\u540c\u671f\u51e6\u7406\u3067HTML\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u3068\u3063\u3066\u3044\u308b\u3002\n<\/p>\n<p>\n\u6700\u8fd1SPA\u30b5\u30a4\u30c8\u3082\u591a\u304f\u306a\u3063\u3066\u304d\u305f\u3057\u3001jinja2\u3092\u3084\u3081\u3066\u3042\u304f\u307e\u3067Python\u306fAPI\u3092\u304b\u3048\u3059\u3060\u3051\u306e\u51e6\u7406\u306b\u3057\u3001<br \/>\n\u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306f\u3059\u3079\u3066\u306eJavascript\u3067\u304d\u308b\u3088\u3046\u306bNuxt\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u305f\u3002\n<\/p>\n<p>\n\u4ee5\u4e0b\u306f\u3053\u308c\u307e\u3067Jinja2\u3092\u4f7f\u3063\u3066\u305f\u4eba\u306b\u3068\u3063\u3066Nuxt\u306e\u4f55\u304c\u3044\u3044\u304b\u3092\u307e\u3068\u3081\u308b\u3002\n<\/p>\n<p><!--more--><!--more--><\/p>\n<h2>\nLayout\u5206\u5272\u306fNuxt\u3082\u540c\u69d8\u306b\u53ef\u80fd<br \/>\n<\/h2>\n<p>\nNuxt\u306e\u5834\u5408\u306f\u3001Layouts\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306bdefault.vue\u3092\u8a18\u8f09\u3059\u308b\u3002\u305d\u3053\u304b\u3089Components\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u30d8\u30c3\u30c0\u30fc\u3084\u30d5\u30c3\u30bf\u30fc\u306e\u5171\u901a\u90e8\u5206\u3092\u8aad\u307f\u8fbc\u307f\u3001Pages\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u914d\u4e0b\u306b\u5404\u30b3\u30f3\u30c6\u30f3\u30c4\u90e8\u5206\u3092\u8a18\u8f09\u3059\u308b\u3002\u4ee5\u4e0b\u306f\u305d\u306e\u4f8b\u3067\u3042\u308b\u3002\n<\/p>\n<p>[javascript]<br \/>\n<template><\/p>\n<div>\n  <body><br \/>\n    <Head \/><\/p>\n<hr >\n<div class=\"container\">\n          <nuxt \/><br \/>\n          <Menu \/>\n    <\/div>\n<hr>\n<div class=\"container\">\n    \t<Foot \/>\n    <\/div>\n<p>  <\/body>\n<\/div>\n<p><\/template><\/p>\n<p><script>\nimport Menu from '@\/components\/Menu.vue';\nimport Head from '@\/components\/Head.vue';\nimport Foot from '@\/components\/Foot.vue';<\/p>\n<p>export default {\n  components:{\n    Head,\n    Menu,\n    Foot,\n  },\n}\n<\/script><br \/>\n[\/javascript]<\/p>\n<p>\n\u4e0a\u8a18\u304cdefault.vue\u3067\u3042\u308b\u3002<br \/>\n[javascript]<\/nuxt>[\/javascript]<br \/>\n\u3068\u306a\u3063\u3066\u3044\u308b\u7b87\u6240\u304cpages\u30d5\u30a1\u30a4\u30eb\u304c\u8aad\u307f\u8fbc\u307e\u308c\u308b\u5834\u6240\u306b\u306a\u308b\u3002\n<\/p>\n<p>\n\u3042\u3068\u306f\u3001\u6587\u5b57\u901a\u308aHead, Menu,Foot\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u306f\u3001\u305d\u308c\u305e\u308c\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8aad\u307f\u8fbc\u3080\u5834\u6240\u3067\u3042\u308b\u3002\n<\/p>\n<h2>\n\u5909\u6570\u3092\u51fa\u529b\u3055\u305b\u305f\u3044\u5834\u5408<br \/>\n<\/h2>\n<p>\nJinja2\u3060\u3068{{}}\u3068\u3057\u3066\u5909\u6570\u306e\u5024\u3092HTML\u306b\u51fa\u529b\u3067\u304d\u308b\u304c\u3001Nuxt\u3082\u540c\u69d8\u3067\u3001{{}}\u3068\u3057\u3066\u5909\u6570\u3092\u51fa\u529b\u53ef\u80fd\u3067\u3042\u308b\u3002<br \/>\n\u4ee5\u4e0b\u306f\u9759\u7684\u306a\u5024\u3092\u51fa\u529b\u3057\u3066\u308b\u3051\u3069\u5b9f\u969b\u306f\u3001axios\u306a\u3069\u4f7f\u3063\u3066\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u305f\u3082\u306e\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u306b\u306a\u308b\u3002\n<\/p>\n<p>[javascript]<br \/>\n<template><\/p>\n<div>\n{{test}}\n<\/div>\n<p><\/template><br \/>\n<script>\nexport default{\n\tasync asyncData(context) {\n    return {\n\t\t\ttest:\"\u3042\u3042\u3042\u3042\u3042\"\n\t\t}\n\t},\n}\n<\/script><\/p>\n<p>[\/javascript]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3082\u3068\u3082\u3068Pyhton\u306ejinja2\u3067\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u51e6\u7406\u3092\u3059\u308b\u3053\u3068\u304c\u591a\u304f\u3001 \u305f\u307e\u306b\u975e\u540c\u671f\u306e\u51e6\u7406\u3092\u884c\u3046\u3068\u304d\u306b\u306fjQuery\u3092\u4f7f\u3063\u3066\u3044\u305f\u304c\u3002\u3067\u3082\u57fa\u672c\u306f\u540c\u671f\u51e6\u7406\u3067HTML\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u3068\u3063\u3066\u3044\u308b\u3002 \u6700\u8fd1SPA\u30b5\u30a4\u30c8\u3082\u591a\u304f\u306a\u3063\u3066\u304d\u305f\u3057\u3001jinja2\u3092\u3084\u3081\u3066\u3042\u304f\u307e\u3067Python\u306fAPI\u3092\u304b\u3048\u3059\u3060\u3051\u306e\u51e6\u7406\u306b\u3057\u3001 \u30d5\u30ed\u30f3\u30c8\u30a8\u30f3\u30c9\u306f\u3059\u3079\u3066\u306eJavascript\u3067\u304d\u308b\u3088\u3046\u306bNuxt\u3092\u4f7f\u3046\u3053\u3068\u306b\u3057\u305f\u3002 \u4ee5\u4e0b\u306f\u3053\u308c\u307e\u3067Jinja2\u3092\u4f7f\u3063\u3066\u305f\u4eba\u306b\u3068\u3063\u3066Nuxt\u306e\u4f55\u304c\u3044\u3044\u304b\u3092\u307e\u3068\u3081\u308b\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,7],"tags":[],"class_list":["post-1298","post","type-post","status-publish","format-standard","hentry","category-20","category-7"],"_links":{"self":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts\/1298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1298"}],"version-history":[{"count":0,"href":"http:\/\/ts-engine.net\/index.php?rest_route=\/wp\/v2\/posts\/1298\/revisions"}],"wp:attachment":[{"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1298"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ts-engine.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}