HTML5¼¼Êõ

Vue.js»ùÓÚ$.ajaxʵÏÖÊý¾ÝµÄ¿çÓòÔöɾ²é¸Ä - keepfool(2)

×ÖºÅ+ ×÷ÕߣºH5Ö®¼Ò À´Ô´£º²©¿ÍÔ° 2016-07-09 11:17 ÎÒÒªÆÀÂÛ( )

C#Æ«ÏòÓÚPascalCaseµÄÃüÃû¹æ·¶£¬¶øJavaScriptÔòÆ«ÏòÓÚcamelCaseµÄÃüÃû¹æ·¶£¬ÎªÁËÈÃJavaScript½ÓÊÕµ½µÄJSONÊý¾ÝÊÇcamelCaseµÄ£¬ÔÚGlobal.asaxÎļþÖÐÌí¼ÓÒÔϼ¸ÐдúÂ룺 var formatters = GlobalConfiguration.Config

C#Æ«ÏòÓÚPascalCaseµÄÃüÃû¹æ·¶£¬¶øJavaScriptÔòÆ«ÏòÓÚcamelCaseµÄÃüÃû¹æ·¶£¬ÎªÁËÈÃJavaScript½ÓÊÕµ½µÄJSONÊý¾ÝÊÇcamelCaseµÄ£¬ÔÚGlobal.asaxÎļþÖÐÌí¼ÓÒÔϼ¸ÐдúÂ룺

var formatters = GlobalConfiguration.Configuration.Formatters; var jsonFormatter = formatters.JsonFormatter; var settings = jsonFormatter.SerializerSettings; settings.Formatting = Formatting.Indented; settings.ContractResolver = new CamelCasePropertyNamesContractResolver();

image

image

¿ÉÒÔÔÚÒÔϵØÖ··ÃÎʹ¹½¨ºÃµÄWeb API£º

:8080/Help

·ÃÎÊCustomersÊý¾Ý£º

:8080/api/Customers

´´½¨×é¼þºÍAjaxHelper

±¾ÎĵÄʾÀýÈÔÈ»ÊDZí¸ñ×é¼þµÄCURD£¬Ö»²»¹ýÕâ´ÎÔÛÃǵÄÊý¾ÝÊÇ´Ó·þÎñ¶Ë»ñÈ¡µÄ¡£
ÔÚʵÏÖÊý¾ÝµÄCURD֮ǰ£¬ÎÒÃÇÏÈ×¼±¸ºÃһЩ×é¼þºÍAjax°ïÖú·½·¨¡£

´´½¨ºÍ×¢²ásimple-grid×é¼þ

simple-grid×é¼þÓÃÓڰ󶨺ÍÏÔʾÊý¾Ý

<template> <table> <thead> <tr> <th v-for="col in columns"> {{ col | capitalize}} </th> </tr> </thead> <tbody> <tr v-for="(index,entry) in dataList"> <td v-for="col in columns"> {{entry[col]}} </td> </tr> </tbody> </table> </template> <script src="js/vue.js"></script> <script> Vue.component('simple-grid', { template: '#grid-template', props: ['dataList', 'columns'] }) </script> ´´½¨ºÍ×¢²ámodal-dialog×é¼þ

Êý¾ÝµÄн¨ºÍ±à¼­½«Ê¹ÓÃģ̬¶Ô»°¿ò£¬modal-dialog×é¼þµÄ×÷ÓþÍÔÚÓÚ´Ë¡£

<template> <div> <div v-bind:class="{ 'dialog-active': show }"> <div> <div> <span @click="close"></span> </div> <slot></slot> <slot></slot> <slot></slot> </div> </div> <div></div> </div> </template> <script> Vue.component('modal-dialog', { template: '#dialog-template', props: ['show'], methods: { close: function() { this.show = false } } }) </script> AjaxHelper

¡¡

1.±¾Õ¾×ñÑ­ÐÐÒµ¹æ·¶£¬ÈκÎתÔصĸå¼þ¶¼»áÃ÷È·±ê×¢×÷ÕߺÍÀ´Ô´£»2.±¾Õ¾µÄÔ­´´ÎÄÕ£¬ÇëתÔØʱÎñ±Ø×¢Ã÷ÎÄÕÂ×÷ÕߺÍÀ´Ô´£¬²»×ðÖØÔ­´´µÄÐÐΪÎÒÃǽ«×·¾¿ÔðÈΣ»3.×÷ÕßͶ¸å¿ÉÄܻᾭÎÒÃDZ༭Ð޸Ļò²¹³ä¡£

Ïà¹ØÎÄÕÂ
  • ËæÓ¦³±Á÷-»ùÓÚABP+AngularjsÏÖ´ú»¯Ó¦ÓÃÈí¼þ¿ª·¢¿ò¼Ü(1)-×ÜÌå½éÉÜ - ÔÚ·ÔÚµÄÕÅ

    ËæÓ¦³±Á÷-»ùÓÚABP+AngularjsÏÖ´ú»¯Ó¦ÓÃÈí¼þ¿ª·¢¿ò¼Ü(1)-×ÜÌå½éÉÜ -

    2017-04-22 08:04

  • »ùÓÚCSSµÄ¸öÈËÍøÒ³ - ÉÇ´ó-Îâ¹ãÁÖ

    »ùÓÚCSSµÄ¸öÈËÍøÒ³ - ÉÇ´ó-Îâ¹ãÁÖ

    2017-04-21 12:00

  • PixiJS - »ùÓÚ WebGL µÄ³¬¿ì HTML5 2D äÖȾÒýÇæ - ÃÎÏëÌì¿Õ£¨É½±ßСϪ£©

    PixiJS - »ùÓÚ WebGL µÄ³¬¿ì HTML5 2D äÖȾÒýÇæ - ÃÎÏëÌì¿Õ£¨É½±ßС

    2017-04-12 08:02

  • ÈÎÎñµ÷¶ÈÖ®³Ö¾Ã»¯£¨»ùÓÚQuartz.net£© - À¶½¨ÈÙ

    ÈÎÎñµ÷¶ÈÖ®³Ö¾Ã»¯£¨»ùÓÚQuartz.net£© - À¶½¨ÈÙ

    2017-03-28 12:03

ÍøÓѵãÆÀ
¨