[{"data":1,"prerenderedAt":439},["ShallowReactive",2],{"content-ja-\u002Fsyntax\u002Fexpressions":3},{"id":4,"title":5,"body":6,"description":432,"extension":433,"meta":434,"navigation":50,"path":435,"seo":436,"stem":437,"__hash__":438},"content_ja\u002Fsyntax\u002Fexpressions.md","式と変数展開",{"type":7,"value":8,"toc":422},"minimark",[9,12,28,64,68,156,159,168,196,202,212,215,226,236,239,276,279,318,320,373,376,394,397,418],[10,11,5],"h1",{"id":5},[13,14,15,16,23,24,27],"p",{},"本文中の変数展開は Mustache 風の ",[17,18,19],"strong",{},[20,21,22],"code",{},"&#123;&#123; &#125;&#125;"," を使います。",[17,25,26],{},"文は書けず、式のみ","です。",[29,30,35],"pre",{"className":31,"code":32,"language":33,"meta":34,"style":34},"language-markdown shiki shiki-themes github-light github-dark","# Hello {{ name }}\n\n- {{ object.animal }} is {{ object.state }}\n- {{ color | \"transparent\" }}\n","markdown","",[20,36,37,45,52,58],{"__ignoreMap":34},[38,39,42],"span",{"class":40,"line":41},"line",1,[38,43,44],{},"# Hello {{ name }}\n",[38,46,48],{"class":40,"line":47},2,[38,49,51],{"emptyLinePlaceholder":50},true,"\n",[38,53,55],{"class":40,"line":54},3,[38,56,57],{},"- {{ object.animal }} is {{ object.state }}\n",[38,59,61],{"class":40,"line":60},4,[38,62,63],{},"- {{ color | \"transparent\" }}\n",[65,66,67],"h2",{"id":67},"書ける式",[69,70,71,84],"table",{},[72,73,74],"thead",{},[75,76,77,81],"tr",{},[78,79,80],"th",{},"種類",[78,82,83],{},"例",[85,86,87,98,108,118,128,136,146],"tbody",{},[75,88,89,93],{},[90,91,92],"td",{},"変数参照",[90,94,95],{},[20,96,97],{},"&#123;&#123; title &#125;&#125;",[75,99,100,103],{},[90,101,102],{},"メンバアクセス",[90,104,105],{},[20,106,107],{},"&#123;&#123; user.name &#125;&#125;",[75,109,110,113],{},[90,111,112],{},"添え字",[90,114,115],{},[20,116,117],{},"&#123;&#123; items[0] &#125;&#125;",[75,119,120,123],{},[90,121,122],{},"三項演算子",[90,124,125],{},[20,126,127],{},"&#123;&#123; isNight ? \"Dark\" : \"Light\" &#125;&#125;",[75,129,130,133],{},[90,131,132],{},"デフォルト値（パイプ）",[90,134,135],{},"`` {{ title",[75,137,138,141],{},[90,139,140],{},"component 呼び出し",[90,142,143],{},[20,144,145],{},"&#123;&#123; cardItem({ title: \"Hi\" }) &#125;&#125;",[75,147,148,151],{},[90,149,150],{},"メソッド",[90,152,153],{},[20,154,155],{},"&#123;&#123; count.toLocaleString('ja-JP') &#125;&#125;",[65,157,132],{"id":158},"デフォルト値パイプ",[29,160,162],{"className":31,"code":161,"language":33,"meta":34,"style":34},"{{ title | \"hardcoded title\" }}\n",[20,163,164],{"__ignoreMap":34},[38,165,166],{"class":40,"line":41},[38,167,161],{},[13,169,170,171,174,175,178,179,178,182,178,185,178,188,191,192,195],{},"左辺が ",[17,172,173],{},"falsy","（",[20,176,177],{},"undefined","、",[20,180,181],{},"null",[20,183,184],{},"\"\"",[20,186,187],{},"0",[20,189,190],{},"false"," など）のとき、右辺を使います。",[20,193,194],{},"||"," 演算子と同じ挙動です。",[65,197,199],{"id":198},"_123123-125125",[20,200,201],{},"&#123;&#123;{ &#125;&#125;}",[13,203,204,205,211],{},"三重括弧も使えます。",[17,206,207,208,210],{},"現状の挙動は ",[20,209,22],{}," と同じ","です（値をそのまま埋め込み）。将来エスケープを導入する際の予約として位置づけています。",[65,213,214],{"id":214},"エスケープ",[13,216,217,219,220,219,222,225],{},[20,218,22],{}," も ",[20,221,201],{},[17,223,224],{},"HTML \u002F Markdown エスケープは行いません","。後段の MD→HTML 変換や、呼び出し側でのサニタイズが必要です。",[13,227,228,229,235],{},"危険そうな値が context に含まれる場合は ",[17,230,231,234],{},[20,232,233],{},"suspicious_context_value"," 警告","が出ますが、値自体は改変しません。",[65,237,238],{"id":238},"親スコープの可視性",[69,240,241,251],{},[72,242,243],{},[75,244,245,248],{},[78,246,247],{},"構文",[78,249,250],{},"親の変数",[85,252,253,261,268],{},[75,254,255,258],{},[90,256,257],{},"include",[90,259,260],{},"見える",[75,262,263,266],{},[90,264,265],{},"component",[90,267,260],{},[75,269,270,273],{},[90,271,272],{},"each 内",[90,274,275],{},"ループ変数・親変数とも見える",[65,277,278],{"id":278},"書けないもの",[280,281,282,293,299,306],"ul",{},[283,284,285,286,178,289,292],"li",{},"文（",[20,287,288],{},"const",[20,290,291],{},"if"," など）— hyogen ブロック内で書く",[283,294,295,298],{},[20,296,297],{},"each"," — 構造ディレクティブとして hyogen ブロックで書く",[283,300,301,302,305],{},"未登録の関数呼び出し（",[20,303,304],{},"foo()"," など）",[283,307,308,311,312,178,315,305],{},[20,309,310],{},".toLocaleString"," 以外のメソッド（",[20,313,314],{},".map",[20,316,317],{},".trim",[65,319,83],{"id":83},[29,321,323],{"className":31,"code":322,"language":33,"meta":34,"style":34},"\u003C!--\n@hg\nconst isNight = false\n@endhg\n-->\n\n# Light Status\n\n- {{ isNight ? \"Dark\" : \"Shine\" }}\n",[20,324,325,330,335,340,345,351,356,362,367],{"__ignoreMap":34},[38,326,327],{"class":40,"line":41},[38,328,329],{},"\u003C!--\n",[38,331,332],{"class":40,"line":47},[38,333,334],{},"@hg\n",[38,336,337],{"class":40,"line":54},[38,338,339],{},"const isNight = false\n",[38,341,342],{"class":40,"line":60},[38,343,344],{},"@endhg\n",[38,346,348],{"class":40,"line":347},5,[38,349,350],{},"-->\n",[38,352,354],{"class":40,"line":353},6,[38,355,51],{"emptyLinePlaceholder":50},[38,357,359],{"class":40,"line":358},7,[38,360,361],{},"# Light Status\n",[38,363,365],{"class":40,"line":364},8,[38,366,51],{"emptyLinePlaceholder":50},[38,368,370],{"class":40,"line":369},9,[38,371,372],{},"- {{ isNight ? \"Dark\" : \"Shine\" }}\n",[13,374,375],{},"出力:",[29,377,379],{"className":31,"code":378,"language":33,"meta":34,"style":34},"# Light Status\n\n- Shine\n",[20,380,381,385,389],{"__ignoreMap":34},[38,382,383],{"class":40,"line":41},[38,384,361],{},[38,386,387],{"class":40,"line":47},[38,388,51],{"emptyLinePlaceholder":50},[38,390,391],{"class":40,"line":54},[38,392,393],{},"- Shine\n",[65,395,396],{"id":396},"関連",[280,398,399,406,412],{},[283,400,401],{},[402,403,405],"a",{"href":404},"\u002Fja\u002Fsyntax\u002Fdeclarations","宣言と代入",[283,407,408],{},[402,409,411],{"href":410},"\u002Fja\u002Fsyntax\u002Fmethods","許可メソッド",[283,413,414],{},[402,415,417],{"href":416},"\u002Fja\u002Fsyntax\u002Fincludes","include と component",[419,420,421],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":34,"searchDepth":47,"depth":47,"links":423},[424,425,426,427,428,429,430,431],{"id":67,"depth":47,"text":67},{"id":158,"depth":47,"text":132},{"id":198,"depth":47,"text":201},{"id":214,"depth":47,"text":214},{"id":238,"depth":47,"text":238},{"id":278,"depth":47,"text":278},{"id":83,"depth":47,"text":83},{"id":396,"depth":47,"text":396},"&#123;&#123; &#125;&#125; による変数展開と式の書き方","md",{},"\u002Fsyntax\u002Fexpressions",{"title":5,"description":432},"syntax\u002Fexpressions","d1KaxPUl9mnZ7oaLcFZ3O7bMryzyu0L54i7NiEIgFrQ",1787223114843]