{"id":102897,"date":"2025-03-24T05:34:50","date_gmt":"2025-03-24T01:04:50","guid":{"rendered":"https:\/\/nabfollower.com\/blog\/submit-not-working-in-vue-typescript-3chi\/"},"modified":"2025-03-24T05:34:50","modified_gmt":"2025-03-24T01:04:50","slug":"submit-not-working-in-vue-typescript-3chi","status":"publish","type":"post","link":"https:\/\/nabfollower.com\/blog\/submit-not-working-in-vue-typescript-3chi\/","title":{"rendered":"submit \u062f\u0631 Vue TypeScript \u06a9\u0627\u0631 \u0646\u0645\u06cc \u06a9\u0646\u062f"},"content":{"rendered":"<p>\u0645\u0646 \u0633\u0639\u06cc \u0645\u06cc \u06a9\u0646\u0645 \u0627\u0632 \u0641\u0631\u0645 \u0627\u0631\u0633\u0627\u0644 \u0634\u062f\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u0645 \u0648 \u0622\u0646 \u0631\u0627 \u0635\u062f\u0627 \u0646\u0645\u06cc \u06a9\u0646\u062f. \u0627\u06cc\u0646 \u06a9\u062f \u0645\u0646 \u0627\u0633\u062a. \u0645\u0637\u0645\u0626\u0646 \u0646\u06cc\u0633\u062a\u0645 \u0686\u0647 \u0627\u0634\u062a\u0628\u0627\u0647\u06cc \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc \u062f\u0647\u0645. \u0628\u0627 \u062a\u0634\u06a9\u0631 \u0628\u0631\u0627\u06cc \u06a9\u0645\u06a9<\/p>\n<p>\u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 VUE: 3.4.18<br \/>\n\u06a9\u0648\u0627\u0632\u0627\u0631: 2.16<\/p>\n<p><\/p>\n<p>                : \u0627\u0631\u0633\u0627\u0644 \u0634\u062f\u0647 = &#8220;message.from == &#39;me&#8221;\u061f \u062f\u0631\u0633\u062a: false &#8221; \/><\/p>\n<p>\n                    <\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>                    &lt;template v-slot:after&gt;\n                        &lt;q-btn round dense flat type=\"button\" color=\"white\" icon=\"send\" \/&gt;\n                    &lt;\/template&gt;\n                &lt;\/q-input&gt;\n            &lt;\/q-form&gt;\n        &lt;\/q-toolbar&gt;\n    &lt;\/q-footer&gt;\n&lt;\/q-page&gt;\n<\/code><\/pre>\n<\/div>\n<p>\u0648\u0627\u0631\u062f\u0627\u062a {ref} \u0627\u0632 &#39;vue&#39; \u061b<\/p>\n<p>\u067e\u06cc\u0627\u0645 \u0647\u0627\u06cc const = ref ([<br \/>\n    {<br \/>\n        text: &#8216;Hey Jim, how are you?&#8217;,<br \/>\n        from: &#8216;me&#8217;<br \/>\n    },<br \/>\n    {<br \/>\n        text: &#8216;Good thanks, Danny! How are you?&#8217;,<br \/>\n        from: &#8216;them&#8217;<br \/>\n    },<br \/>\n    {<br \/>\n        text: &#8216;Pretty good!&#8217;,<br \/>\n        from: &#8216;me&#8217;<br \/>\n    }<br \/>\n]) \u061b<\/p>\n<p>const newmessage = ref (&#39;&#39;) \u061b<\/p>\n<p>\u062a\u0627\u0628\u0639 onsubmit () {<br \/>\n    console.log (&#39;\u0627\u0631\u0633\u0627\u0644 \u067e\u06cc\u0627\u0645:&#39; \u060c newmessage.value) \u061b<br \/>\n    Messages.Value.push ({<br \/>\n        \u0645\u062a\u0646: newmessage.value \u060c<br \/>\n        \u0627\u0632: &#8220;\u0645\u0646&#8221;<br \/>\n    }) \u061b<br \/>\n    newMessage.Value = &#8220;&#8221; \u061b<\/p>\n<div class=\"highlight js-code-highlight\">\n<pre class=\"highlight plaintext\"><code>console.log('Sending message:', newMessage.value);\n\nnewMessage.value=\"\";\n<\/code><\/pre>\n<\/div>\n<p>} \u061b<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0645\u0646 \u0633\u0639\u06cc \u0645\u06cc \u06a9\u0646\u0645 \u0627\u0632 \u0641\u0631\u0645 \u0627\u0631\u0633\u0627\u0644 \u0634\u062f\u0647 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u0645 \u0648 \u0622\u0646 \u0631\u0627 \u0635\u062f\u0627 \u0646\u0645\u06cc \u06a9\u0646\u062f. \u0627\u06cc\u0646 \u06a9\u062f \u0645\u0646 \u0627\u0633\u062a. \u0645\u0637\u0645\u0626\u0646 \u0646\u06cc\u0633\u062a\u0645 \u0686\u0647 \u0627\u0634\u062a\u0628\u0627\u0647\u06cc \u0627\u0646\u062c\u0627\u0645 \u0645\u06cc \u062f\u0647\u0645. \u0628\u0627 \u062a\u0634\u06a9\u0631 \u0628\u0631\u0627\u06cc \u06a9\u0645\u06a9 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 VUE: 3.4.18 \u06a9\u0648\u0627\u0632\u0627\u0631: 2.16 : \u0627\u0631\u0633\u0627\u0644 \u0634\u062f\u0647 = &#8220;message.from == &#39;me&#8221;\u061f \u062f\u0631\u0633\u062a: false &#8221; \/> &lt;template v-slot:after&gt; &lt;q-btn round dense flat &hellip;<\/p>\n","protected":false},"author":2,"featured_media":102898,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","footnotes":""},"categories":[339],"tags":[],"class_list":["post-102897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dev"],"_links":{"self":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/102897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/comments?post=102897"}],"version-history":[{"count":0,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/posts\/102897\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media\/102898"}],"wp:attachment":[{"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/media?parent=102897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/categories?post=102897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nabfollower.com\/blog\/wp-json\/wp\/v2\/tags?post=102897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}