Basic Query Service - Vue.js Sample



Click To Run


Click To Run

					  <ul>
						<li v-for="doc in docs" class="data">
							<span style="display:none" class="dataid">{{doc.ContentID}}</span>
							  {{ doc.Content.DisplayName }} <br>
							  {{ doc.Attributes.Date }} <br>
							  <span v-html="doc.Summary.Text"></span>
							  <hr>
						</li>
					  </ul>
					
			function Run() {
				if(window.vueDLV)
					window.vueDLV.$destroy();
				$("#DLV").show();
				$(".firstTime").remove();
				window.vueDLV=new Vue({
				  el: '#DLV',
				  data: {
					docs: []
				  },
				  created: function () {
					var that=this;
					var GeodiServerUrl=$("#serverUrl").val();
					var GeodiWsName= $("#wsName").val();
					var GeodiToken=$("#token").val();
					$.post(GeodiServerUrl+'/QueryHandler?op=Query',  {
								q:$("#q").val(),
								wsName:GeodiWsName,
								UserSession:GeodiToken,
								options: JSON.stringify ({ SummaryFill:true })
							},
							function(data) {
								$("#jsonResponse").html(json2html(data));
								that.docs=data;
							}
						, 'json')
				  }
				  }
				 )
			 }